Chaining RxJS Observables from http data in Angular2 with TypeScript
For your use case, I think that the flatMap operator is what you need: this.userData.getUserPhotos(‘123456’).flatMap(data => { this.userPhotos = data; return this.userData.getUserInfo(); }).subscribe(data => { this.userInfo = data; }); This way, you will execute the second request once the first one is received. The flatMap operator is particularly useful when you want to use the … Read more