I am trying to transfer data from AngularJS to ASP.net MVC and always gets zero. Here is my code (only posting the main, button, controller, and C #:
HTML:
<a class="btn btn-grey btn-lg btn-block" ng-click="AddCar()">Save</a>
controller
$scope.AddCar = function () { $http.post("Cars/AddCar", JSON.stringify($scope.new.JsonCar)).success(function (data) { Alert(ok) })
FROM#
public string AddCar(string JsonCar) { try .... }
In JSON.stringify ($ scope.new.JsonCar) I get the following:
"{" Name ":" FIAT 500 "," Description ":" New car "" MaxUserCapacity ": 5," PhotoPath ":" no "}"
What am I doing wrong?
angularjs c # asp.net-mvc angularjs-controller angularjs-directive
Luis
source share