Hi
I am using http.jsonp request to call json data which returns 500 objects. it takes time to load .So i am calling this response page by page.Reach page has 10 objects.First page is loading faster.How to load these data using ion inifinte scroll.I couldnt append the remaining page results. below is my code.
services.js
getloadpage: function(id) {
$http.jsonp(this.endpoint + ‘/getmydata/?page=’+id+’&callback=JSON_CALLBACK’,{cache:true}).success(function(postdata){
cacheEngine.put(‘loadpage’, postdata);
deferred.resolve(postdata);
});
return deferred.promise;
}
Controller.js
.controller(‘TestCtrl’, function($scope,$location,$ionicLoading, MYDATA) {
$scope.allpostdata = [];
$scope.pageno = 1;
MYDATA.getloadpage($scope.pageno).then(function (data) {
$scope.data = data;
console.log($scope.data);
});
$scope.loadmore = function (){
Blog.getloadpage(2).then(function (data){
$scope.data = data
$scope.$broadcast(‘scroll.infiniteScrollComplete’);
console.log($scope.data);
});
}
$scope.loadmore();
})
HTML
{{post.title}}
View Details
Can Somebody please please help me.I am stuck on this.
Thanks in advance
Ash