diff --git a/js/angular/directive/infiniteScroll.js b/js/angular/directive/infiniteScroll.js index 1466c1f96d..fd9f916f53 100644 --- a/js/angular/directive/infiniteScroll.js +++ b/js/angular/directive/infiniteScroll.js @@ -72,7 +72,9 @@ IonicModule restrict: 'E', require: ['^$ionicScroll', 'ionInfiniteScroll'], template: '', - scope: true, + scope: { + load: '&onInfinite' + }, controller: ['$scope', '$attrs', function($scope, $attrs) { this.isLoading = false; this.scrollView = null; //given by link function @@ -102,7 +104,7 @@ IonicModule var onInfinite = function() { $element[0].classList.add('active'); infiniteScrollCtrl.isLoading = true; - $scope.$parent && $scope.$parent.$apply($attrs.onInfinite || ''); + $scope.load(); }; var finishInfiniteScroll = function() { @@ -125,7 +127,7 @@ IonicModule var checkBounds = ionic.animationFrameThrottle(checkInfiniteBounds); //Check bounds on start, after scrollView is fully rendered - setTimeout(checkBounds); + $timeout(checkBounds, 0, false); scrollCtrl.$element.on('scroll', checkBounds); function checkInfiniteBounds() {