Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Infinite scroll ionic framewrok:Loadmore() called multiple times

$
0
0

I am using ionic infinite scroll to load data from php api service.

The problem is The method defined on the on-infinite property (ie loadmore function) is called multiple times when it reaches the bottom.

Here is my code

<div class="card" ng-repeat="result in results">
 <div>{{result.name}}</div>
</div>
<ion-infinite-scroll immediate-check="false" on-infinite="loadMore()" distance="10%" ng-if="!noMoreItemsAvailable"></ion-infinite-scroll>

Here is my controller js

$scope.loadMore=function(){

        console.log("Load more item clicked");
   //get data from api service
   $http.get(url+').then(function(msg){
       $scope.results=$scope.results.concat(msg.data)
     });
};

I will get the console message Load more item clicked multiple times when it reaches the bottom sometimes it become infinite times.
Does anyone know why it is happen?


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>