I\'ve been building a SPA with Angular 4 on the front end and ASP.NET Core 2 on the Backend. Basically, I\'m trying to automatically renew an user login, given a valid token. Wh
You can not use the async/await syntax with Observables returned by Angular HttpClient so you first need to convert the observable to a promise first.
Luckily the Observable interface exports a toPromise()
method which returns a promise from the observable:
await this.net.get('Authentication/GetUser').toPromise();
See this example of how to use Async/Await with Angular HttpClient