目前,我的应用程序会将XHR设置为服务器以获取用户信息。
我已将CanActivate和CanActivateChild设置为:
{
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' },
]
}
当我转到XHR发送两次的/a
时,Angular会同时并行运行CanActivate和CanActivateChild,但不会先CanActivate
CanActivateChild
?