Angular 5 chain service observables then return observable to component
问题 I have two rest calls I need to make. Rest call 2 depends on rest call 1. And I want to store each result in the service before proceeding. Then I want to return an observable to the component that calls rest call 1 so the component can subscribe in case of issues. code from service: login(username: string, password: string): Observable<AuthAccess> { // rest call 1 return this.getAuthClient() .flatMap(res => { this.client = res.body; // rest call 2 return this.authenticate(username, password)