IOS infinite-scroll doesn't load data


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;
        $scope.LimitC =;
        if($scope.limitC > 10){
          $scope.moredata = false;
        $scope.categoryQuestions =;

      $scope.loadMoreCategoryQuestions = function(){
        $http.get($rootScope.url+'category/'+$scope.catID+'/questions/v1?page='+$scope.catpage).then(function(response) {
        console.log("LImit IS:"+$scope.LimitC);

        $scope.categoryQuestions = $scope.categoryQuestions.concat(;
        if($scope.categoryQuestions.length >= $scope.LimitC){
          $scope.moredata = true;

         $scope.catpage = $scope.catpage+1;


i would say your requests fails and you do not have any error handling…

then() can take a second callback function for error handling --> check if any error occurs :wink:

Btw. you should create a service for API communication


I implemented error handling, there is no error. I checked url in postman it works well. I set $scope.moredata = false so it should trigger loadMore function but it doesn’t. It works only when i open app first login then go to my category questions and it doesn’t work. when i sign out then login again it works. It doesn’t load in first login but after reload it works. BTW this is only for iPhone, on android it works just fine.


why are you define your loadMore function inside of the “byCategory” function?

I think the loadMore function would be enough for loading the first page and every page after.

Are there some errors in the JavaScript console in the WebDev Tools in chrome or firefox?