I am working on an Ionic
app ( 2.0.0-rc0
) which depends on angular 2
. So the new introduction of ngModules
is included.
The other answers mention this but the basic summary is:
Material dialog components are created inside the TS code and not the template:
const dialogRef = this.dialog.open(MyExampleDialog, { width: '250px' });
}
This requires you to register it as an entryComponent:
entryComponents: [MyExampleDialog]
Otherwise you get a error:
ERROR Error: No component factory found for MyExampleDialog. Did you add it to @NgModule.entryComponents?