angular6

Angular 6/7 by default uses Eager/Lazy loading? [closed]

孤者浪人 提交于 2019-12-23 19:29:53
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . As the title says, do we need to manually implement Lazy Loading for the modules or does Angular 6/7 does it by default? 回答1: Angular by default uses eager loading unless specified otherwise. To implement Lazy Loading, following things need to be specified to the RouterModule : A

Angular 6 Nested FormGroup Template Validation

一曲冷凌霜 提交于 2019-12-23 19:14:54
问题 My form group structure looks like this (order.component.ts): this.orderForm = this.formBuilder.group({ customer: this.formBuilder.group({ name: ['', Validators.required], phone: ['', Validators.required], email: ['', Validators.required] }), ... }); In the template (order.component.html) I have: <form [formGroup]="orderForm" (ngSubmit)="onSubmit()"> <fieldset formGroupName="customer"> <legend>Customer Information</legend> <label for="name">Full name:</label> <input type="text"

Bootstrap not working in Angular 6 app

亡梦爱人 提交于 2019-12-23 15:54:18
问题 I want to make use of Bootstrap in an Angular 6 app and here is what I have done so far but nothing seems to be working out: 1) Installed bootstrap, jquery and popper.js using npm. 2) Entered the following in the Angular.json file "styles": [ "src/styles.scss", "node_modules/bootstrap/scss/bootstrap.scss" ], "scripts": [ "node_modules/jquery/dist/jquery.slim.min.js", "node_modules/popper.js/dist/umd/popper.min.js", "node_modules/bootstrap/dist/js/bootstrap.min.js" ... ] Am I missing something

Angular 6 + Bootstrap 4 Select all and Deselect all Checkboxes

会有一股神秘感。 提交于 2019-12-23 13:25:17
问题 I'm having an issue trying to get Bootstrap 4 Checkboxes working with a select all and deselect all option in angular 6+. I can get it to work when I use the original code here: http://www.angulartutorial.net/2017/04/select-all-deselect-all-checkbox.html But the issue is Bootstrap uses a different event to click their checkboxes. Does anyone have a solution for this? <div class="form-check"> <input class="form-check-input" type="checkbox" (change)="selectAll()"> <label class="form-check-label

Angular 6 @angular/pwa - sw does not successfuly serve the manifest's start_url

点点圈 提交于 2019-12-23 13:07:37
问题 I've built a PWA using angular 6 and the @angular/pwa package. I've been trying to fix this but no matter what I do, I'm getting the start_url error. I have tried: Using absolute links Making sure the start_url is within the SW's scope (sw is in the main folder) Using the filename "/index.html" as I've seen in other support threads here. Clearing all browser history and cache everytime. Searching through Github issues on the @angular/pwa package Searching google in general for this PWA issue.

Bind image from service in angular 6

二次信任 提交于 2019-12-23 12:40:37
问题 I have an endpoint that provides me an image based on certain parameter. It's not an image url, its a plain image. So when i hit the endpoint in postman, in response, i receive an image (JPG). I do i receive this image in a variable and bind it in tag of HTML? All the questions have solution for mapping an image url to image, whereas mine is an image which i have to display in UI. show-image-component.ts this.appservice.getImage().subscribe((image) => { console.log(image); } ) service.ts

Angular 6 Prod Function calls are not supported in decorators but '..Module' was called

試著忘記壹切 提交于 2019-12-23 11:46:40
问题 I have this error when trying to use angular2-json-schema-form & build in prod ERROR in Error during template compile of 'DemoModule' Function calls are not supported in decorators but 'JsonSchemaFormModule' was called. I found out that the the error comes from: @NgModule({ declarations: [ AceEditorDirective, DemoComponent, DemoRootComponent ], imports: [ BrowserModule, BrowserAnimationsModule, FlexLayoutModule, FormsModule, HttpClientModule, MatButtonModule, MatCardModule, MatCheckboxModule,

Debouncetime in Angular6 ngModelChange

て烟熏妆下的殇ゞ 提交于 2019-12-23 11:39:10
问题 I have a complex calculator app written in Angular6 which calculates the results based of several inputs in the ngModelChange event and to show these results in charts directly. The calculation is done server side. Now I want to add a debouncetime, so the server dont receive a request with every key pressed. My calculation method which is fires in the ngModelChange looks like this: async calculate(){ if(this.checkInputs()){ try{ let returnDto = await this.webApiService.calculate(new

Observable.fromEvent - RXJS

旧城冷巷雨未停 提交于 2019-12-23 07:52:52
问题 I'm trying to create an Observable from an input event. I have already tried almost everything and I can not import "fromEvent". This is my code. I am using angular 6.0.1 and RXJS 6.1.0 error TS2339: Property 'fromEvent' does not exist on type 'typeof Observable'. import { Directive, EventEmitter, Input, Output, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { NgControl } from '@angular/forms'; import { distinctUntilChanged } from 'rxjs/internal/operators

Observable.fromEvent - RXJS

夙愿已清 提交于 2019-12-23 07:52:22
问题 I'm trying to create an Observable from an input event. I have already tried almost everything and I can not import "fromEvent". This is my code. I am using angular 6.0.1 and RXJS 6.1.0 error TS2339: Property 'fromEvent' does not exist on type 'typeof Observable'. import { Directive, EventEmitter, Input, Output, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { NgControl } from '@angular/forms'; import { distinctUntilChanged } from 'rxjs/internal/operators