Getting <ion-content> with ViewChild in Ionic 4


I was used to retrieve ion-content with @ViewChild like

@ViewChild(Content) public content: Content;

But it doesn’t work anymore with Ionic4 (shadow dom consequence ?). I’m trying to access Content scroll methods.

How are you retrieving Content with Ionic4 ?


Ok. There is a bit of answer here:

But I still can’t get it (beta11)

so I already commented the GitHub issue but about scroll and content, you know that there is a handy event emitter?

<ion-content (ionScroll)="doSomethingOnScroll($event)">