javascript - How do I update/add to a JSON file using angularJS? -


i've created local json file , able data file using

app.controller('appctrl', function($scope, $http){   $http.get('employees.json').success(function(data){   $scope.employees=angular.fromjson(data.employees);   console.log($scope.employees); });  //this data json file taken , stored $scope.employees. works fine } 

i've been trying write equivalent http post call doing $scope.employees.push, (understandably) updating value of local variable.

how update or add values original employees.json file?

i don't think it's possible directly angular. there other sources integrate app, can have angular leverage.

you store localstorage , access other object. method i'd lean towards more (depending on size). otherwise i've had have server-side it.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -