ng-modules

Angular2 : Dynamic component creation : AOT Compilation

馋奶兔 提交于 2019-11-30 14:01:34
问题 Below is my initial code to create dynamic module : protected createComponentModule(componentType: any) { @NgModule({ imports: [ ComponentModule ], declarations: [ componentType ], }) class RuntimeComponentModule { } return RuntimeComponentModule; } While I am going to implement AOT on below code it throw me error: No NgModule metadata found for 'RuntimeComponentModule' I found solution of it some Articals by change below code and my error gone away: default class RuntimeComponentModule { }

Angular2 : Dynamic component creation : AOT Compilation

依然范特西╮ 提交于 2019-11-30 08:55:16
Below is my initial code to create dynamic module : protected createComponentModule(componentType: any) { @NgModule({ imports: [ ComponentModule ], declarations: [ componentType ], }) class RuntimeComponentModule { } return RuntimeComponentModule; } While I am going to implement AOT on below code it throw me error: No NgModule metadata found for 'RuntimeComponentModule' I found solution of it some Articals by change below code and my error gone away: default class RuntimeComponentModule { } But new error is raised it say: Modifiers cannot appear here It not allowed me to decorate @NgModule

Angular 2 - Unexpected Module declared by AppModule

帅比萌擦擦* 提交于 2019-11-30 08:36:21
问题 I am new to angular and trying to separate my modules in Angular2 app having the following directory structure. I have my module and other components declared in the AppModule, but I am getting an error in browser console that Unexpected HomeModule declared by AppModule app --authentication ---- htmls, ts, css --home ----dashboard --------html, ts, css ----representativs --------html, ts, css ----home-routing.module.ts ----home.module.ts --app.routing.ts --app.module.ts app.module.ts import {