Angular2: I want to use the result of .subscribe() in a consequent observable.
This is in order to use the id from the parent subscribe in the nested subscribe.
I've tried using .switchMap() first, but this doesn't seem to work.
This is my attempt:
this.serviceA.getOrg()
.switchMap(org => this.serviceB.getOrgType(org.id))
.subscribe(type => {
console.log(type);
});