I'm very new in AngularJS. I want to post registration data to a json file. Post request is working correctly,but data is not writing to file. I can't understand that position. Is there something wrong with my post request code? And how can I fix that? Thanks!
var regModel = {
FirstName: 'Someone',
LastName: 'Somebody',
Address: 'somewhere',
Email: '[email protected]'
};
$scope.insertUser = function () {
$http.post('../DB/users.json', regModel).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
}).
error(function(data, status, headers, config) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
}