I have following setup:
let result = service.getResults(); result.data.forEach((row:any) => { this.myService .getObject(row.id) .subscribe((object:any) => { //... }) ); } I want do do something, after all the subscriptions of getObject(row.id) have finished. I know there's the add() function but it will do this for every Subscription. Coming from Promises I would have stored every Promise and then in an array and just called Promise.all().
.toPromise()and then you know how to deal with itcomplete()method of the observer. For example, HTTP requests returns observable and the observable is finished once its subscription is fired.