更新时间:2023-02-13 09:32:54
scope.save = function(position){
http.post(serviceBase +'Positions',{model:
scope.position})
.success(function(data){
});
Hi all,
i am learning Angularjs . i have a code:controller.js
$scope.save = function (position) { $http.post(serviceBase + 'Positions', { model: $scope.position }) .success(function (data) { });
$scope.position
already returns an object {Name: "Name",Description:"Description"{
In api:
[HttpPost] public HttpResponseMessage Post(Position model) { }
But in api i can not get model . It's properties are null.
Pls help me in this code. Thanks.
I already have tried :
$http.post(serviceBase + 'Positions', $scope.position)
But it is same.
scope.save = function (position) {
http.post(serviceBase + 'Positions', { model:
scope.position }) .success(function (data) { });