Currently my application will set a XHR to server to get user information.
I have set CanActivate and CanActivateChild like:
{
path: '',
canActivate: [AuthService],
canActivateChild: [AuthService],
children: [
{
path: 'a',
component: AComponent,
},
{ path: 'b1', component: B1Component },
{ path: 'b2', component: B2Component },
{
path: 'c',
component: CComponent,
pathMatch: 'full',
},
{ path: 'd/create', component: DComponent },
{ path: 'd/:id', component: DComponent, pathMatch: 'full' },
]
}
When I go to /a
that XHR sent twice so Angular will run CanActivate and CanActivateChild at the same time in parallel but not CanActivate
first then CanActivateChild
?