import { NgModule } from '@angular/core' ; import { MatDialogModule } from '@angular/material' ; import { BrowserModule } from '@angular/platform-browser' ; import { NoopAnimationsModule } from '@angular/platform-browser/animations' ; import { AppComponent } from './app.component' ; import { DynamicComponentLoaderModule , DynamicComponentManifest } from './dynamic-component-loader/dynamic-component-loader.module' ; import { DialogComponent } from './dynamic-modules/dialog/dialog.component' ; import { DialogModule } from './dynamic-modules/dialog/dialog.module' ; const manifests = [ { componentId : 'message' , path : 'dynamic-message' , loadChildren : ( ) => import ( './dynamic-modules/message/message.module' ) . then ( m => m . MessageModule ) } , { componentId : 'dialog' , path : 'dialog' , loadChildren : ( ) => import ( './dynamic-modules/dialog/dialog.module' ) . then ( m => m . DialogModule ) } ] ; @ NgModule ( { declarations : [ AppComponent ] , imports : [ BrowserModule , DialogModule , MatDialogModule , NoopAnimationsModule , DynamicComponentLoaderModule . forRoot ( manifests ) ] , providers : [ ] , bootstrap : [ AppComponent ] , entryComponents : [ DialogComponent ] } ) export class AppModule { }