Could you show me what you did? Because I’m pretty sure I’m not implementing my sub-page correctly.
I added a page with ‘ng generate page name’. I currently have it in the AppRoutingModule like so
// master
{
path: 'agenda',
loadChildren: './agenda/agenda.module#AgendaPageModule'
},
// sub
{
path: 'agenda/:id',
loadChildren: './agenda-detail/agenda-detail.module#AgendaDetailPageModule'
},
When I tried to add it to the AgendaPageModules routes, it showed the AgendaDetailPage when routing to ‘/agenda’ and the AgendaPage when routing to ‘/agenda/:id’. I could not figure out why (I had removed ‘/agenda/:id’ from AppRoutingModule).
This is what the AgendaPageModule lokked like then (did not touch AgendaDetailPageModule):
const routes: Routes = [
{
path: '',
component: AgendaPage,
children: [
{
path: ':id',
component: AgendaDetailPage
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes),
ComponentsModule,
AgendaDetailPageModule
],
declarations: [
AgendaPage,
AgendaTabComponent
],
providers: [AgendaService]
})
export class AgendaPageModule { }