Вы получили плохую маршрутизацию, она должна выглядеть так:
в app.routing.
export const AppRoutes: Routes = [
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: 'dashboard', loadChildren: './moduleDashboard/dashboard.module#DashboardModule' },
{ path: 'customer', loadChildren: './moduleCustomer/customer.module#CustomerModule'}, // its an client or customer ?
{ path: 'pages', loadChildren: './pages/pages.module#PagesModule' }
];
в dashboard.routing.ts
export const DashboardRoutes: Routes = [
{ path: '', component: DashboardComponent }
];
в customer.routing.ts
export const CustomerRoutes: Routes = [
{ path: '', component: CustomerComponent , children: [ // customerRoute have to have his own Component may be this is main problem.
{ path: 'clil', component: CustomerListComponent },
{ path: 'clid/:customerReference', component: CustomerAllDetailComponent }
]
}];
А что это за AdminLeyoutComponent
? если он не имеет его собственного path:
, который следует за шаблоном как <app-admin-leyout></app-admin-leyout>
.
если вы хотите пройти все маршруты через AdminLayoutComponent
:
в AdminLayoutComponent.html:
<div class="some-code">
<ng-content></ng-content>
</div>
в AppComponent.html:
<app-admin-layout>
<router-outlet></router-outlet>
</app-admin-layout>