$ ionicScrollDelegate.getScrollPosition () always returns 0

me and I realize that $ ionicScrollDelegate.getScrollPosition () returns 0, but only when the vistaviene SICEDE from another view with $ state.go. if the direct route upgrade there if it works

$scope.showItem = function(index){
CategoriaDatos.selectItem = $scope.locales[index];
$state.go('app.local');   
}

la vista:

.controller('CategoriaLocal', function($scope,$http,CategoriaDatos,$ionicScrollDelegate) {
              $scope.onScoll = function() {
                  console.log($ionicScrollDelegate.getScrollPosition().top);
                    if($ionicScrollDelegate.getScrollPosition().top >= 100) {
                 $scope.boolChangeClass = true;
                 console.log('Scrolled below header.');
                                          console.log($ionicScrollDelegate.getScrollPosition().top);

             } else {
                 $scope.boolChangeClass = false;
                 console.log('Header is in view.');
                                   console.log($ionicScrollDelegate.getScrollPosition().top);

             }
            }})