Here data is not inserting ...it showing error in the client side only....
Can any one help me ???
var app = angular.module("myApp", []);
app.controller("myCntrl", function ($scope, myService) {
$scope.SaveUser = function () {
var User = {
Name: $scope.txtName,
Age: $scope.txtAge,
};
var response = myService.AddUser(User);
response.then(function (data) {
alert("User Created !");
});
}
});
app.Service("myService", function ($http) {
debugger;
this.AddUser = function (User) {
var response = $http({
method: "post",
url: "/Register/AddUser",
data: JSON.stringify(User),
dataType: "json"
});
return response;
}
});

Manas MohapatraPosted Jul 29, 2017, 1:03 AM
Manikandan MurugesanPosted Jul 28, 2017, 8:19 PM