1

我在 angular 4 ( v 4.2.6 ) 上的解析器有问题

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

主线:

{  

    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'

        }

产品模块路线:

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

        },{

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

        }
    ]
}

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

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

谢谢

4

0 回答 0