@ionicUser wrote:
Hello everyone
I need some help with an angular related topic.
I have a lazy loaded page and on initialization it should load a component.
But with the component declared the page won’t load.info.module.ts
import { IonicModule } from '@ionic/angular'; import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { InfoPage } from './info.page'; import { AttendeeComponent } from "../attendee/attendee.component"; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, RouterModule.forChild([{ path: '', component: InfoPage }]) ], declarations: [ InfoPage, AttendeeComponent ] }) export class InfoPageModule {}
info.page.html
<ion-content> <app-attendee></app-attendee> </ion-content>
app-routing.module.ts
{ path: 'info', loadChildren: './info/info.module#InfoPageModule' }
and I call this page with
this.router.navigate(['info'])
If I remove AttendeeComponent from declarations the page loads.
I really don’t know what I’m missing here…
Posts: 1
Participants: 1