Reputation: 11
I'm Trying to create a Google material design Dialog component & load dynamically a "XYZ" component inside it.
When this module (which has imported MatDialogModule) is lazy loaded, Angular keep yellings "No component factory found for DynamicComponent. Did you add it to @NgModule.entryComponents?" although "XYZ" component was added to entryComponents list of the lazy loaded module.
This error is not raised when module is eagerly loaded.
Any idea what I'm missing?
"dependencies": {
"@angular/animations": "6.0.0",
"@angular/cdk": "6.0.1",
"@angular/common": "6.0.0",
"@angular/compiler": "6.0.0",
"@angular/core": "6.0.0",
"@angular/forms": "6.0.0",
"@angular/http": "6.0.0",
"@angular/material": "6.0.1",
"@angular/platform-browser": "6.0.0",
"@angular/platform-browser-dynamic": "6.0.0",
"@angular/router": "6.0.0",
"@ngrx/store": "^6.0.1",
"ag-grid": "18.0.1",
"ag-grid-angular": "18.0.1",
"bootstrap": "4.1.1",
"core-js": "2.5.6",
"font-awesome": "4.7.0",
"ng4-click-outside": "1.0.1",
"rxjs": "6.1.0",
"rxjs-compat": "6.1.0",
"zone.js": "0.8.26"
},
Upvotes: 0
Views: 325
Reputation: 1209
kindly check if your DynamicComponent is declared both in your declarations and entryComponents in the app.module.ts
Upvotes: 2