I'm getting mad: I'm working with angular js and I don't know how to post data correctly.
I've filled some html input fields, whose values are stored in (ex.) $scope.prodotto, and I must send the json structure of $scope.product to a webservice I've written.
Unfortunately using the inspector, I' can't see anything.
I mean: I've written this:
$scope.salva = function() {
console.log($scope.prodotto);
$http.post('./service/prodotti/create', $scope.prodotto).error(function(data, status, headers, config){
console.log($scope.prodotto);
});
};
Salva is binded to a button. through ng-click argument. When I click the button, "salva" is triggered. I see that $scope.prodotto is populated with the right values (thanks to console.log), but...the server receives nothing, and the browser doesn't send anything (inspecting the req with chrome's inspector, shows an empty array)
So what am I doing wrong?
Thanks in advance!
.in your server path?