I'm trying to post the data that is in a modal form on the user hitting send through a HTTP.POST method but I'm having trouble figuring out how to actually access the data object in the post function i have made or if Im even sending it correctly. Any help is greatly appreciated
http.post in index.html:
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');
};
};
process post function in 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));
})