Hi all.
i try to use infinite scroll and it works fine when i scroll down. But my app not showing previous page when im scrolling up. Is somebody has a solution?
This is my code JS
$scope.loadMore = function() {
$http.get('http://safiahijab.com/wp-json/posts/?page='+$scope.page).success(function(data) {
vm.news = data;
console.log("LOAD DATA", data);
$scope.$broadcast('scroll.infiniteScrollComplete');
console.log($scope.page);
$scope.page +=1;
});
};
and this is my HTML
<ion-list>
<div ng-repeat="news in vm.news">
<a ng-click="selectNews(news.ID)">
<div class="title-list">{{news.title}}</div>
</a>
</div>
</ion-list>
<ion-infinite-scroll ng-if="!noMoreItemsAvailable" on-infinite="loadMore()" distance="1%"></ion-infinite-scroll>
Thank you