I have some code that looks like
//service.ts
addProduct(productId) {
this.http.post(\'someUrl\', ReqData).map(json).subscribe(doStuff);
}
//component.
You can use the Observable.merge(). Try something like that
addProduct(productId):Observable {
return this.http.post('someUrl', productId);
}
addAllproducts(productsIds) {
let productedsObservable:Observable[]=[];
for(let productID in productsIds){
this.productedsObservable.push(this.addProduct(productID));
}
return Observable.merge(productedsObservable)
}
You need to subscribe to the requested function for it the execute the http request. You can read more about combination operators (like merge) here