Search code examples
angularjsjsonfilepostput

Angularjs How can i post/put/delete data into local json file?


Angularjs How can i post/put data into local json file?

To get data, i do:

App.factory('serv', ['$http', function ($http) {
  var data = {};
  db.getdata = function(){
    return $http.get('data/album.json');
  }
  return data;
}])

I dont know how to do for POST , PUT and DELETE.

Is it possible?


Solution

  • You can try this useful Angular API : https://github.com/mgonto/restangular

    if you want to manage data saved in a json file then you can use this JSON server : https://github.com/typicode/json-server