I am developing a web site by using Angular/.Net core.
I am using async/await in ngOnInit() method to await the results.
async ngOnInit() {
let response= await this.loginservice.availabilities(this._searchinfo).toPromise();
console.log("no of units");
}
ngAfterViewInit() {
console.log("Call ngAfterViewInit");
}
Though I used await/async, the system called ngAfterViewInit() method before returning the results from ngOnInit().
That means, If I check the console, I can see below readings from the console
Call ngAfterViewInit
no of units
How is this possible?. When using await/async, isn’t it going to block other life cycle hooks?
Thanks in advance.
2