Reputation: 437
I am getting this error when trying to open a modal component:
No component factory found for [ComponentName].
Did you add it to @NgModule.entryComponents?
The same modal is working elsewhere in the app so it has been added to the declarations
and entryComponents
sections of NgModule
.
Is there anything else this message could mean?
Upvotes: 0
Views: 5669
Reputation: 12378
Most likely you use dynamically loaded components like a dialog window. If this is the case, you need to list them in the entryComponents property of @NgModule, for example:
entryComponents: [
MyDialogComponent
]
You can see an example here: https://material.angular.io/components/dialog/overview
Upvotes: 4