Hi, i have a problem with infinite scroll in my app. my code works on android but not on iphone. On iphone when i scroll down it doesnt load data and keeps loading…
ion-infinite-scroll distance=“1%” on-infinite=“loadMoreCategoryQuestions()” ng-if="!moredata"></ion-infinite-scroll
$scope.byCategory = function(id){
$scope.catpage = 1;
$scope.catID = id;
//$scope.moredata = true;
$http.get($rootScope.url+'category/'+id+'/questions/v1?page=0').then(function(response){
$scope.LimitC = response.data.totalElements;
if($scope.limitC > 10){
$scope.moredata = false;
}
$scope.categoryQuestions = response.data.content;
$scope.categoryQuestionModal.show();
console.log($scope.LimitC);
console.log($scope.moredata);
});
$scope.loadMoreCategoryQuestions = function(){
console.log("YES");
$http.get($rootScope.url+'category/'+$scope.catID+'/questions/v1?page='+$scope.catpage).then(function(response) {
console.log("LImit IS:"+$scope.LimitC);
console.log($scope.catpage);
console.log(response.data.content.length);
$scope.categoryQuestions = $scope.categoryQuestions.concat(response.data.content);
if($scope.categoryQuestions.length >= $scope.LimitC){
$scope.moredata = true;
}
$scope.$broadcast('scroll.infiniteScrollComplete');
$scope.catpage = $scope.catpage+1;
});
}
}