First of all, I’d like to create a directive, which is complete, and does not depend on any external controllers, which implement on-scroll handler.
Thus, I’m trying to scope.$watch($ionicScrollDelegate.getScrollPosition, function(new, old){});
But, I’ve got Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
PS For some reason an alternate $watch($(element).offset().top, ...)
is not fired in spite it is changed.
Can someone help me either to realize how to handle scrolling events within an isolated directive inside <ion-content/>
, or what’s wrong with $(element).offset().top
please?