I've created a local JSON file and am able to get data from the 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 is where the data from the json file is taken and stored into $scope.employees. works fine
}
I've been trying to write an equivalent http POST call by doing a $scope.employees.push
, but it is only (understandably) updating the value of the local variable.
How do I update or add values to the original employees.json
file?
post
data back to it to store int he originatingemployees.json
file. – Billy Moon Apr 7 at 22:05