Scroll Spy on List Item Divider

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

By reading ionic doc I realized I should listen to drag event instead of scroll…

If you need to do something with our scroller, you should check out this codepen example.

Can you be more detailed please, trying to do the same but…no success