I’m attempting to have a function run after the user has scrolled down or up a page. The current hierarchy of my app is:
ion-side-menus > ion-side-menu-content > ion-content > [actual content]
with the ion-content having the following attribute:
on-scroll-complete="onComplete"
in my app.js, I have the following:
.controller('HomeCtrl', function($scope, $ionicScrollDelegate) {
$scope.data = {
title : 'Top: ?'
};
$scope.onComplete = function() {
$scope.data.title = "Top : " + $ionicScrollDelegate.getScrollPosition().top;
};
});
However, this function doesn’t run at all. Is this the correct way to be going about it or is there something I’m missing? I’m very new to Ionic, so perhaps I’m placing the function in the wrong scope?
Any help or guidance is appreciated!