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().subscribe(res => {
if(res){
this.collection.addItem(res);
}
});
I'm in a component lazyloading :
{
path: 'types-aides',
loadChildren: 'app/modules/aides/aides.module#AidesModule'
},
But I have this error :
Error: No component factory found for TypesAidesAjouterComponent. Did you add it to @NgModule.entryComponents?
I have found a solution, it is to move remove the LazyLoading but my application is large and is not a possibility.
Do you have any suggestions ?