I have a problem with Observables in Angluar2 app. Let assume hypothetical situation that I need to make two separate http calls. One call depends directly on the result of the other. The code looks like this:
this.http.get('http://kalafior/group/'+id)
.map(res => res.json())
.subscribe(group => {
//url depends on previous call result
this.http.get('http://kalafior/group/'+group.id+'/posts')
.map(res => res.json())
.subscribe((res) => {
console.log(res);
});
});
There are nested subscribe() calls which I want to get rid of.