app.controller('CustomerListController', function ($scope, customerService) {
$scope.CustomerList = [{ "CustomerId": 1, "CustomerName": "deeksha", "Age": 23 }, { "CustomerId": 2, "CustomerName": "pooja", "Age": 34 }];
$scope.Add = function () {
alert(JSON.stringify($scope.CustomerList));
customerService.addCustomer(JSON.stringify($scope.CustomerList));
};
});
and Service is like
var customerAPI = '/api/customer/:Id';
app.factory("Customer", function ($resource) {
return $resource(
customerAPI,
{ Id: "@Id" },
{
"update": { method: "PUT", isArray: true }
}
);
});
app.service("customerService", function ($resource, Customer) {
this.addCustomer = function (customerDetail) {
Customer.save(customerDetail);
};
});
I am not getting where is problem because value is being sent by client side and I can see it in firebug but server side web api controller is showing null value.I want solution of it
Thanks in advance to you .