我的路由模块中有一个解析器
{
path: 'path1',
component: FirstComponent,
resolve: {
allOrders: DataResolver
}
}
然后在我的解析功能中有
resolve(): Observable<Array<string>> {
return this.serviceA.getAllfooNames()
.map(result=> {
/* result is an array of strings*/
return this.serviceB.getAllBarNames(result[0])
/*orders is also supposed to be an array of strings*/
.map(orders=> return orders)
});
}
}
我希望根据allOrders键存储价值订单。我想将订单数组作为 ActivatedRoute 快照中的数据传递。请帮忙。