I have tried to lazy-load open a modal in Ionic 5. I have multiple modals to be opened in the same page, so I thought of doing a single function that will open the modal by their string name, given through parameter. It worked on Ionic 3 and also it's written on the ionic 5 documentation. See image below:
Here's the code:
async presentModal(modalName: string) {
const modal = await this.modalCtrl.create({
component: modalName,
componentProps: {
'note': this.massageNote.content
}
});
return await modal.present();
}
The function call:
presentModal('AssessmentSectionModalPage');
When calling the function, here's the error I get.
Error: No component factory found for AssessmentSectionModalPage. Did you add it to @NgModule.entryComponents?
I have also imported the 'AssessmentSectionModalPageModule' in my page's module, but still getting this. Any help? Thanks!
