如果设置,CanActivate和CanActivateChild会同时运行吗?

时间:2017-05-18 02:39:40

标签: angular rxjs canactivate

目前,我的应用程序会将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

0 个答案:

没有答案