ionic-framework
ionic-framework copied to clipboard
Content.addScrollListner can't read class variables
Short description of the problem:
Content.addScrollListner can't read class variables
What behavior are you expecting?
I want to access the instance variable on page scroll.
Steps to reproduce:
- Use the sample code from the Ionic2 documentation http://ionicframework.com/docs/v2/2.0.0-alpha.55/api/components/content/Content/
- I see the console output saying 'They see me scrolling...'
- Adding an instance variable ctr:number = 1;
- Upon scrolling in content, I still see the message 'They see me scrolling...' but the prints "NaN" in the console log.
insert any relevant code between the above and below backticks
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Which Ionic Version? 1.x or 2.x
Run ionic info from terminal/cmd prompt: (paste output below)
Try using this.content.addScrollEventListener(this.myScroll.bind(this));