I am trying to use the scroll event of ion-content inside of directive as in https://www.joshmorony.com /high-performance-parallax-animation-in-ionic-2/. But scroll event is not triggered.
What to look for? (How can I to use addScrollListener and directive together?)
If you want to capture when ion-content is scrolling, try the following in your directive.
See: https://github.com/driftyco/ionic/blob/master/src/components/content/content.ts for more info
import { Content } from 'ionic-angular';
then in your constructor
constructor(private content:Content) {
}
Then add
ngOnInit(){
this.content.ionScroll.subscribe(data => {
console.log('scrolling...');
}
}
I’m do it . nothings is happen,some one say this is reason ionic version,must be 2.1