Hey there! I'm currently working on implementing lazy loading with a modal component. Here's how my shared components module looks like:
@NgModule({
declarations: [
AddNoteComponent,
EditNoteComponent
],
imports: [
IonicModule,
],
exports: [
AddNoteComponent,
EditNoteComponent
]
})
export class ComponentsModule {}
In order to use these components in the notes.ts page, I imported the ComponentsModule class into the notes.module.ts file as follows:
@NgModule({
declarations: [
NotesPage,
],
imports: [
IonicPageModule.forChild(NotesPage),
ComponentsModule,
],
})
export class NotesPageModule {}
Now, within my notes.ts file, this function should be functional
addNoteModal() {
let noteModal = this.modalCtrl.create('AddNoteComponent', {
'mid': this.module.key
});
noteModal.present();
}
This setup should work flawlessly with lazy loading enabled,
but I'm encountering an error message from Ionic:
ERROR Error: Uncaught (in promise): invalid link: AddNoteComponent
Here are the details of 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