angular4儿童解析器不会等待父解析器

时间:2017-08-24 14:14:19

标签: angular angular-routing angular-router

我在角4(v 4.2.6)

上遇到了旋转变压器的问题

我有一个很深的路线结构,如:

MainRoute:

{  

    path: 'o',
    loadChildren: './organization/organization.module#OrganizationModule'

},{

    path: 'signin',
    component: LoginComponent

},{

OrganizarionModule路线

{
    path: ':orgId',
    component: OrganizationComponent,
    canActivate: [AuthGuard],
    resolve: {
        organizations: OrganizationResolve
    },
    children: [
        {
            path: 'products',
            loadChildren: './products/products.module#ProductsModule'

        },{

            path: 'user',
            loadChildren: './user/user.module#UserModule'

        },{

            path: '',
            redirectTo: 'products',
            pathMatch: 'full'

        }

ProductsModule路线:

{
    path: '',
    component: ProductsComponent,
    children: [
        {
            path: 'welcome',
            component: ProductsWelcome

        },{

            path: 'active',
            component: ProductsActive,
            resolve: {
                product: ProductsResolve
            }

        }
    ]
}

我需要ProductsResolve(最后一级孩子)等到OragnizationResolve完成。

OrganizationResolve为我提供了一个令牌,可以帮助我获得该组织的产品。在其他请求开始之前是否有其他方法可以运行该解析器?

由于

0 个答案:

没有答案