I am making a below api call on ngOnInit I want to force it to wait untill data returned to Dto before calling to ngAfterViewInit event as I am doing operation on that data there. As such its not waiting and moving to ngAfterViewInit where my Dto is undefined and then coming back to ngOnInit subscribe to load which I dont want. Any help appreciated.
this.subscriptions.add(
this.gridService
.GetGridByName(
this.gridName,
'1.0'
)
.subscribe({
next: (data: any) => {
if (data.result) {
// should wait for this dto to load before hitting to ngAfterViewInit
this.gridDto = data.result;
}
},