저는 AngularJS에서 매우 새로 왔습니다. json 파일에 등록 데이터를 게시하고 싶습니다. 게시물 요청이 올바르게 작동하지만 데이터가 파일에 쓰지 않습니다. 나는 그 위치를 이해할 수 없다. 내 게시물 요청 코드에 문제가 있습니까? 어떻게 해결할 수 있습니까? 감사!
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.
});
}
즉, 클라이언트 쪽에서 파일에 쓸 수 없다는 의미입니다. – Hayot
클라이언트 측에서 알려진 방법을 알지 못합니다. –