I need to make chained http calls to api. In first response I get observable, then I use map operator and return this result:
getAreaByKey(key: string): Observable<Area> {
return this.http.get<any[]>(`${this.api}/areas/${key}`).pipe(
map(result => {
return {
'key': result['Key'],
'name': result['Description'],
'experts': result['Experts']
};
})
);
}
Then I need to make another http call with parameter result['Experts'], which is array with ID's. How can I pass that parameter to next call? I've tried to use SwitchMap, but there is no result. And how to save response data from this calls? because I need to use both in my template.