I used Ionic 5 & @ionic/angular to create an empty project, and in the app.component.ts file, I tried to access a directive like the following:
Inside ngAfterViewInit(), the this._directive object is undefined. I am not sure why it is not working. Thanks for your thoughts in advance!
Interestingly, I can access this._directive if the ViewChild is declared like the following:
I suspect there is something wrong with Ionic library as a pure Angular project works fine with either approaches.