"On-scroll" not working in <ion-content>

The current way to do it is like this:

HTML:

<ion-content id="my-content">

JS:

// Need to wait until the component has been initialized
ngAfterViewInit() {
 // Here 'my-content' is the ID of my ion-content
 this.content = this.app.getComponent('my-content');
 this.content.addScrollEventListener(this.onPageScroll);
}

onPageScroll() {
  console.log('They see me scrolling...');
}

Where did you see an on-scroll attribute?

3 Likes