I'm trying to insert the data I get from my API, into the SQLITE database of my app, I already researched a lot but besides not being able to do it, I could not figure out how to do this.
Here is the code for my service
:
app.service('CategoriesService', function($http, $q) {
var url = 'http://meusite.com.br/api/';
return {
allCategories: function() {
return $http.get(url).then(function(response) {
var json = JSON.stringify(response.data);
console.log(JSON);
return response.data;
});
}
}
})
I started using stringify
to see if it was easier to insert, but I could not do with the examples I found, let alone the tests I did.