带辅助路由的解析器

问题描述 投票:0回答:1

我的新Angular有一个带有3个widget的Dashboard。对于一个小部件(PreviousInquiriesComponent)我想添加一个解析器,使该widget在数据准备好之前不会显示。

    children: [
      {
        path: '',
        component: ProfileComponent,
        outlet: 'outlet1'
      },
      {
        path: '',
        component: PreviousInquiriesComponent,
        outlet: 'outlet2',
        resolve: {
          inquiries: InquiryResolver
        },
      },
      {
        path: '',
        component: ProfileComponent,
        outlet: 'outlet3'
      }
    ]},```


But when I add the resolver, none of the widgets in the dashboard loads until data for that widget is ready. How can I solve this issue? Should I avoid using resolvers here?
angular angular-routing angular-router angular-resolver
1个回答
0
投票

如果这三个组件的路由不同,就不会出现这个问题。要么改变你的路由配置,使其具有不同的子路由,要么从这里删除resolution。

© www.soinside.com 2019 - 2024. All rights reserved.