我的新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?
如果这三个组件的路由不同,就不会出现这个问题。要么改变你的路由配置,使其具有不同的子路由,要么从这里删除resolution。