In my routing module, I have a resolver implemented like this:
{
path: 'path1',
component: FirstComponent,
resolve: {
allOrders: DataResolver
}
}
Within the resolve function of DataResolver, the following logic exists:
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)
});
}
}
I am seeking help on how to store the value of orders under the key allOrders. Additionally, I need guidance on passing the orders array as data in the ActivatedRoute snapshot. Any assistance would be greatly appreciated.