I have this route:
{
path: 'dashboard',
loadChildren: '../pages/dashboard/dashboard.module#DashboardModule'
}
With the dashboard
's router looking like this:
@NgModule({
imports: [
ComponentsModule,
SharedModule,
RouterModule.forChild([
{
path: '',
component: DashboardComponent
}
])
],
declarations: [
DashboardComponent
]
})
export class DashboardRouterModule {}
And in my parent view (which is /admin
, dashboard route is /admin/dashboard
), I have a <router-outlet name="admin"></router-outlet>
, but I can't seem to figure out the syntax for this because I just get a bunch of errors whenever I try.
Here's what I tried:
{
path: 'dashboard(admin: '')',
loadChildren: '../pages/dashboard/dashboard.module#DashboardModule'
}
{
path: 'dashboard(admin: dashboard)',
loadChildren: '../pages/dashboard/dashboard.module#DashboardModule'
}
(router):
{
path: '(dashboard: '')',
component: DashboardComponent
}
{
path: '',
component: DashboardComponent,
outlet: 'admin'
}
What is the correct way?