HTTP.POST 메서드를 통해 전송되는 사용자에게 모달 폼의 데이터를 게시하려고하지만 실제 처리 방법을 찾지 못했습니다. 나는 포스트 함수에서 데이터 객체에 접근한다. 어떤 도움을 크게 index.html을에 모달 폼 (모서리)의 데이터 http http.post
http.post
를 감사 :var ModalInstanceCtrl = function($scope, $uibModalInstance, $http, data) {
$scope.data = data;
$scope.ok = function() {
$http.post("http://127.0.0.1:8081/process_post")
.then(function (response) {$scope.data = response.data;});
$uibModalInstance.close();
};
$scope.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
};
처리 후 기능을 app.js에 :
app.post('/process_post', urlencodedParser, function (req, res) {
// Prepare output in JSON format
//response = req;
//console.log(req.body.data);
//res.end(JSON.stringify(response));
})
해당 노드는 있습니까? – codemax
게시 기능에 데이터가 표시되지 않습니다. –
예 노드가 –