I can succesully make multiple parallel http calls using the forkjoin operator (example call all sales data) however I need to concatenate further http calls based on the results of each of the first (sales ) http calls. I'm not sure if the mergeMap or concat operators are best and how they fit in here
example data is sales
{saleId:100, name:'bob, uri:'http://testserver/sales/100'}
{saleId:101, name:'fred, uri:'http://testserver/sales/101'}
{saleId:102, name:'billy, uri:'http://testserver/sales/102'}
products
{id:1,saleId:101, detail:'test1', product:{id:200, uri:'http://testserver/product/200'} }
{id:1,saleId:101, detail:'test1', product:{id:201, uri:'http://testserver/product/201'} }
{id:1,saleId:101, detail:'test1', product:{id:202, uri:'http://testserver/product/202'} }
getServerChildNodes(childNodeObj: any[]): Observable<any> {
//observablesListArray contains http sales uri
return forkJoin(observablesListArray)
.map((data: any[]) => {
for (let i = 0; i < data.length; i++) {
outputData.push(data[i].json());
}
return outputData;
});
}