我尝试在给定两个字段的值的情况下发送角度模型,然后将其存储在
通过Web API的数据库
$scope.Add = function () {
var EmpModel =
{
emp_name: emp_name,
emp_sallery: emp_sallery,
emp_designation: emp_designation
}
$scope.EmpModel = EmpModel
$http({
method: 'Post',
url: 'Test/EmployeeDataService/EmployeeInformation',
data: JSON.stringify(EmpModel)
})
.then(function (response) {
$scope.data = response.data;
},
function (error) {
alert(error)
$scope.DisplayAlert = function (error) {
alert(error);
}
});
}