Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to save and sync remote json data with sqlite

$
0
0

@zakieddouh wrote:

Below is my code AngularJS, I want to store all this data in SQLite and synchronization with the service $ http.jsonp.
For it to work in offline mode.

.controller('ActualitesCtrl', function($scope, $http) {

$scope.actualites = [];
$scope.page=1;
$scope.noMoreItemsAvailable = false;
$scope.loadMore = function() {
$http.jsonp("http://technopark.ma/api/get_recent_posts/?post_type=news&page="+$scope.page+"&callback=JSON_CALLBACK")
   .success(function(data) {
       var i = data.posts.length;
       if(i!=0)

{
$scope.actualites = $scope.actualites.concat(data.posts);
$scope.$broadcast('scroll.infiniteScrollComplete');
$scope.page +=1;
}
else
{
$scope.noMoreItemsAvailable = true;
}
});
};

})

Zak

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



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