Angular 2 observable subscribing twice executes call twice
You may use the share operator on your result from HttpClient.get, like this: var observable = this.httpClient.get(‘api/version/secured’, { headers: httpHeaders }) .pipe(share()); You’ll need to add the following import on top of your script: import { share } from ‘rxjs/operators’; The share operator makes an observable hot, i.e. shared between subscribers. But there’s a lot … Read more