Skip to content
Advertisement

Tag: async-await

Stop executing code until my async/await HttpClient get operation finishes executing code (including html calls)

I need to execute HttpClient get request synchronously so I found a solution on internet to use toPromise instead of subscribe and then await. However I have noticed that the this.form = = this.formBuilder.group line of code executes before myAccount is initialized by the async call. In other words I was expecting that the execution code will block until this.myAccount

Javascript don’t want to use await

I have an async function like that: When I call this method, I am calling it like that: It works well in this way. But I don’t want to use the await keyword when calling this method. If I remove the await keyword, it waits forever in this line: await page.setRequestInterception(true); It should work on the background I don’t want

Advertisement