Here us my routing module.
@NgModule({
imports: [
RouterModule.forChild([
{
path: "",
component: AdminComponent,
children: [
{
path: "users",
component: ParentComponent
children: [
{
path: ":id",
component: AnotherComponent
}
]
}
]
}]
)
],
exports: [
RouterModule
]
})
export class AdminRoutingModule {}
By doing so, I need to specify in my ParentComponent a <router-outlet></router-outlet>. The only problem here is that AnotherComponent isn't a part of ParentComponent, these are two different pages. So maybe a better structure would be to have them at the same level. The reason why I went for the that structure was because AnotherComponent can only be reached from the ParentComponent. What's the most sensible thing to do in here ?