I am developing a large application using Angular 2
and ASP.net
MVC.
I have approximately 120 components in my application which are all declared i
You can build a shared module and add the components to this module, then you only have to add the shared module to imports: [MySharedModule]
and all components and directives exported by MySharedModule
become available to the importing module.
@NgModule({
imports: [ CommonModule ],
declarations: [ Component1, Component2, Component3.... Component120
],
exports: [ Component1, Component2, Component3.... Component120 ],
})
export class MySharedModule {}
@NgModule({
declarations: [AppComponent],
bootstrap: [AppComponent],
imports: [BrowserModule, MySharedModule]
})
class AppModule {}