I am trying to map from a service call but getting an error. Looked at subscribe is not defined in angular 2? and it said that in order to subscribe we need to
map
I was forgetting to return the other observable in pipe(switchMap(
pipe(switchMap(
this.dataService.getPerson(personId).pipe( switchMap(person => { //this.dataService.getCompany(person.companyId); // return missing return this.dataService.getCompany(person.companyId); }) )