Hi!
I’m trying to do a scroll spy feature, like there is on ionic doc page. I want to know when a list item divider reaches the top of page, so I can update some info on the header bar.
Does some on have tried to do so?
I tried this directive but it never gets to the scroll callback. If I use the $scrollDelegate.$anchorScroll() to scroll to a certain item divider, the directive’s scroll calback is triggred.
angular.module('myModule)
.directive('myDirective', function ($window) {
return function(scope, element, attrs){
angular.element($window).bind('scroll', function(){
debugger;
scope.offset = this.pageYOffset;
scope.$apply();
});
}
});
Any thoughts on that?
Thx