I have multiple child components that share the same component which works fine, however, I cannot route between the pages as it appears Angular suspects the component is already loaded. Is it possible to reload the component when attempting to route to these child routes?
const ServicesRouting: ModuleWithProviders = RouterModule.forChild([
{
path: '',
component: StructureComponent,
canActivate: [AuthGuard],
children: [
{
path: 'services',
canActivate: [AuthGuard],
component: servicesComponent,
children: [
{
path: 'one',
canActivate: [AuthGuard],
component: servicesComponent,
},
{
path: 'two',
canActivate: [AuthGuard],
component: servicesComponent,
},
{
path: 'three',
canActivate: [AuthGuard],
component: servicesComponent,
},
{
path: 'four',
canActivate: [AuthGuard],
component: servicesComponent,
}
]
}
]
}
]);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…