I have a component which first need to call a service that POST something. Then in the same component I want to wait until the POST is done, to call another service which
Better use switchMap()
here.
const versions$ = this._newVersionService.createNewVersion(vnr)
.switchMap(response => this._versionService.getAvailableVersions());
versions$.subscribe(response2 => this.versions = response2)
But the problem will be if you make another POST request before first has been resolved, the previous request will get cancelled.