I am trying to keep track of when a user scrolls in IScroll (v5).
I'm still new to angular and just learning about writing directives. From other examples, I try. My directive
app.directive ('watchScrolling', function () {
return {
restrict: 'E',
link: function (scope, elem, attr, ctrl) {
elem.bind ('scroll', function (e) {
console.log ('scrolling');
});
}
};
});
and in my html
<div id = "wrapper" class = "watch-scrolling">
<iv class = "scroller"> </div>
</div>
I use ngIscroll to connect a scroller.
So should I write my directive? Or should I use the $ .watch method ??? Any suggestions on how to make this work?
source share