Angular 5 synchronous HTTP call
问题 I have an Angular 5 application in which I have to call some heavy REST service (usually takes some seconds). I need its result in different part of application, so I would like to store the result in a DataStorageService. Basically, this is I would like to achieve: @Injectable() export class DataStorageService { private result: MyCustomObject; constructor(private service: Service) {} getResult(): MyCustomObject { if (typeof this.result === 'undefined') { // save result } return result; } The