Back in my Angular 1 days, I used to nest HTTP calls and react to their results like this:
this.$qSessionPromise
.then(() => {
return this.Init();
})
.then(() => {
return this.Services.GetData1("id1");
})
.then((data: model.DataType1) => {
this.data = data;
})
.then(() => {
this.SetIsInitialized(true);
this.handler = new MyHandler(this.data);
this.RegisterEvents();
});
However, in Angular 2, I couldn't figure out a similar approach...
When using the subscribe method, it seemed impossible to add another subscribe method...
this.service.GetData1()
.subscribe(data:model.DataType1 => {
this.data = data;
return this.Services.GetData2("id2");
})
.subscribe(data:model.DataType2 => {
this.data = data;
})
Is there a workaround for this issue?