Unable to get route working with 2 levels of lazy loaded modules (nested)
Youd shouldn't use pathMatch: 'full'
export const Product1Routes: Routes = [
{
path: '',
component: Product1Component,
children:[
{
path: 'dashboard',
loadChildren: 'app/product1/dashboard/dashboard.module#DashboardModule'
// or './dashboard/...
},
{
path: '',
component: Product1ViewComponent
}
]
}
];
I also changed loadChildren
path a bit. (added app/product1
)
Why are you importing HttpModule
for each of lazy loaded modules?
This is also redundant in lazy loaded modules
providers: [{ provide: LocationStrategy, useClass: HashLocationStrategy }],
P.S. I would create Routing modules for each of modules
app-routing.module.ts
product1-routing.module.ts
dashboard-routing.module.ts
and so on