in my program I have a func in canActivateChild that need to occur after canActivate finished , but the child component loads befor canActivate of the parent finish,why?
my routing-module:
const routes: Routes = [
{
path: '',
component: MainComponent,
canActivate: [LoadDataGuard, ConfigureJsGuard],
canActivateChild: [EnterChildGuard],
canDeactivate: [CleanupJsGuard],
data: {
modelService: ModelService,
} ,
children: [
{
component: ChildComponent,
.......
you can add
canActivateChild
to empty path child of main routelike