angular5

_lazy_route_resource lazy namespace object

北战南征 提交于 2020-01-02 01:31:07
问题 I'm using angular compiler: const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; With these compiler options: "angularCompilerOptions": { "genDir": "./build/compiled", "outDir": "./build/compiled", "skipMetadataEmit": true, "debug": true}, Relevant part of my package.json is: "@ngtools/webpack": "^6.0.0", "@angular/router": "^5.2.0", "webpack": "4.8.3", "webpack-cli": "2.1.4", And my angularCompilerPlugin config is: new AngularCompilerPlugin({ tsConfigPath: 'path

Angular : Unable to GET local json using HttpClient

試著忘記壹切 提交于 2020-01-01 21:09:28
问题 I am using the latest HttpClient component provided in Angular5 to make a get request for local json but I am getting 404 ever since. I have already imported HttpClientModule module in my app.module.ts . Snapshot of folder structure: I am making the call from blog-detail component for blog-list.json . Here is my code: constructor(private http: HttpClient) { } ngOnInit(): void { // this.http.get('https://jsonplaceholder.typicode.com/posts/1').subscribe((data:Blog[]) => { this.http.get('app/api

Type Error: observable.of is not a function - angular-cli@1.6.3 - rxjs@5.5.x - angular5

末鹿安然 提交于 2019-12-31 04:09:11
问题 After upgrading to angular-cli@1.6.3 and converting all the RxJS imports, methods, and operators to the new >5.5 form, I get a type error at run-time saying that Observable.of is not a function. The same error happens with all the methods that are defined as a member of an extension of Observable , for example, Observable.fromEvent . On the other hand, the methods that are defined as stand alone functions, like Observable.combineLatest run properly despite the compiler warns that them don't

Angular - Can't bind to 'ngValue' since it isn't a known property of 'mat-option'

拜拜、爱过 提交于 2019-12-30 17:33:20
问题 I'm using angular 5 and I'm getting the console error: Can't bind to 'ngValue' since it isn't a known property of 'mat-option' My template looks something like as follows: <mat-select placeholder="Select Book" name="patient" [(ngModel)]="selectedBook"> <mat-option *ngFor="let eachBook of books" [ngValue]="eachBook">{{eachBook.name}}</mat-option> </mat-select> I've imported both MatSelectModule and MatOptionModule . How can we resolve this? 回答1: You should use value [value]="eachBook" 回答2: The

In angular (v5) how do I listen to my apps Redux state object changing?

白昼怎懂夜的黑 提交于 2019-12-30 12:13:30
问题 I need to know how to create a listener e.g. I want to subscribe to the AppState changing. Below is my current very basic service. I have a dispatch action on the view which increments the counter. Once the counter changes value I'd like to detect this in other parts of my website e.g. the global header for example. I'm using ng2-Redux with angular version 5. Redux service: export interface IAppState { counter: number; } export const INITIAL_APP_STATE: IAppState = { counter: 0 }; export

No provider for ControlContainer - Angular 5

自古美人都是妖i 提交于 2019-12-30 07:55:13
问题 I am converting a purchased, third-party template into an Angular 5 app, and just ran into an error. I am very new to Angular 5 (I know AngularJS well however) and don't understand what it's trying to tell me? It seems to be related to a button which shows/hides the top navbar. Error Message (from browser): Error: Template parse errors: No provider for ControlContainer ("imalize-styl-2 btn btn-primary " (click)="toggleNavigation()"><i class="fa fa-bars"></i> </a> [ERROR ->]<form role="search"

Getting error in Angular 5 Datatables: cannot reinitialise DataTable

南楼画角 提交于 2019-12-30 06:36:47
问题 I am working on the angular based project. I am using datatables to display data. When I try to do some modifications on the table, I get the following error. DataTables warning: table id=DataTables_Table_0 - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3 回答1: I think it is because you are using [dtTrigger]="dtTrigger" in Angular DataTables and rerendering the table on the same page. If you have this problem you should use the

Getting error in Angular 5 Datatables: cannot reinitialise DataTable

非 Y 不嫁゛ 提交于 2019-12-30 06:36:09
问题 I am working on the angular based project. I am using datatables to display data. When I try to do some modifications on the table, I get the following error. DataTables warning: table id=DataTables_Table_0 - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3 回答1: I think it is because you are using [dtTrigger]="dtTrigger" in Angular DataTables and rerendering the table on the same page. If you have this problem you should use the

EntryComponents in Module for LazyLoading

删除回忆录丶 提交于 2019-12-30 06:02:11
问题 I want to load a modal from a component. In Angular Material documentation is write to add the modal component in entryComponents : This : @NgModule({ imports: [ CommonModule, AidesRoutingModule ], declarations: [TypesAidesComponent, TypesAidesAjouterComponent], entryComponents : [TypesAidesAjouterComponent] }) export class AidesModule { } In TypesAidesComponent I want open dialog with TypesAidesAjouterComponent : let dialog = this.dialog.open(TypesAidesAjouterComponent); dialog.afterClosed()

EntryComponents in Module for LazyLoading

自闭症网瘾萝莉.ら 提交于 2019-12-30 06:02:03
问题 I want to load a modal from a component. In Angular Material documentation is write to add the modal component in entryComponents : This : @NgModule({ imports: [ CommonModule, AidesRoutingModule ], declarations: [TypesAidesComponent, TypesAidesAjouterComponent], entryComponents : [TypesAidesAjouterComponent] }) export class AidesModule { } In TypesAidesComponent I want open dialog with TypesAidesAjouterComponent : let dialog = this.dialog.open(TypesAidesAjouterComponent); dialog.afterClosed()