hello i'm trying use to use lazy loading with modal component, so i have a shared components module like this:
@NgModule({
declarations: [
AddNoteComponent,
EditNoteComponent
],
imports: [
IonicModule,
],
exports: [
AddNoteComponent,
EditNoteComponent
]
})
export class ComponentsModule {}
i want to use them in notes.ts page, so i imported the componentsModule class to the notes.module.ts like this:
@NgModule({
declarations: [
NotesPage,
],
imports: [
IonicPageModule.forChild(NotesPage),
ComponentsModule,
],
})
export class NotesPageModule {}
so in my notes.ts this function should work
addNoteModal() {
let noteModal = this.modalCtrl.create('AddNoteComponent', {
'mid': this.module.key
});
noteModal.present();
}
this should work pefectly while i use lazy loading,
but ionic tells me that :
ERROR Error: Uncaught (in promise): invalid link: AddNoteComponent
here is my environment :
Ionic Framework: 3.9.2
Ionic App Scripts: 3.1.2
Angular Core: 5.0.1
Angular Compiler CLI: 5.0.1
Node: 8.4.0
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Mobile Safari/537.36
AddNoteComponent
should be a page, i.e. it should have a@IonicPage()
decorator.