Angular 5 synchronous HTTP call
Try using await/async
async getResult(): Promise<MyCustomObject> {
if (typeof this.result === 'undefined')
{
// save result
this.result = await this.service.call()
.toPromise()
.then(resp =>resp as MyCustomObject);//Do you own cast here
}
return this.result;
}