Hi everybody,
im trying to integrate a infinite-scroll into a view
my content looks like
<ion-content on-infinite-scroll="nextItems()">
<a class="item item-icon-left" ng-repeat="article in articles | limitTo: scroll.limitVisible track by article.id"
ng-click="selectItem(article)">
<i class="icon ion-pricetag"></i>
</a>
<ion-infinite-scroll ></ion-infinite-scroll>
</ion-content>
The next items function :
$scope.nextItems = function() {
console.log('loading next items', $scope.scroll.limitVisible , $scope.articles.length);
if ($scope.scroll.limitVisible < $scope.articles.length && $scope.scroll.moreArticlesLoaded) {
$scope.scroll.limitVisible = $scope.scroll.limitVisible+ 50;
$scope.$broadcast('scroll.infiniteScrollComplete');
console.log('done ',$scope.scroll.limitVisible);
}
else {
console.log('no more items to load');
$scope.$broadcast('scroll.infiniteScrollComplete');
$scope.$emit('scroll.infiniteScrollComplete');
}
};
The problem is that the nextItems functions gets invoked many many times until angularJS stops with
Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Event there is no
<ion-infinite-scroll ></ion-infinite-scroll>
in my view the nextItems gets invoked very often
Need some help please
Regards