rx.js – chain requests when need response from BOTH
On the end i need response from BOTH requests, but need chain them, because second request need something from first response. import { switchMap, map } from ‘rxjs/operators’; this.restService.getFile(id) .pipe( switchMap((file:File) => this.restService.renderMd(file.markdown_id) .pipe(map((markdown:any) => { return { file:file, markdow: markdown }; })) ) ).subscribe((result:any) => { // I have results for two requests Read more about rx.js – chain requests when need response from BOTH[…]