$ionicScrollDelegate doesn't have a onScroll event?

I would like to use on-scroll event, but not using the on-scroll attribute, is there someway to do this?

Something like:

$ionicScrollDelegate.$on('onScroll', function (data) {
  console.log(data.position.top); // etc...
});

Or using $scope…

$scope.$on('ionicView.onScroll', function (data) {
  console.log(data.position.top); // etc...
});

Thanks.

I solved this using:

$ionicScrollDelegate.getScrollView().onScroll = function () {
  console.log($ionicScrollDelegate.getScrollPosition());
});

Would be great if these function of getScrollView() as onScroll was documented.

Thanks :smiley:

1 Like

Improve this doc https://github.com/driftyco/ionic/edit/master/js/angular/service/scrollDelegate.js#L2

unfortunately this has stopped working with I think 1.2.4. (works for sure with 1.1.1). it still works in desktop browser, but no longer on an android phone.

anyone got a solution?