Hello Everyone我通过Angular ajax调用获取数据 这是电话
$scope.EditOperator = function ($event) {
$event.stopPropagation();
var ID = $scope.idSelectedOperator;
$http.post('/api/privilege/editopap/' + $scope.idSelectedOperator)
.success(function (data, status) {
$scope.Operator=data;
$scope.Operator.Name = data.name;
alert($scope.Operator.Name)
$scope.Operator.Password = $scope.EditOperator.name;
$scope.Operator.Email = data.email;
$scope.$applyAsync();
toastr.success("Update Successfully");
}).error(function () {
toastr.error("Something went wrong");
});
};
我正在获取我想要的数据,但是当我尝试在
中分配数据时 $scope.Operator.Name = data.name;
然后它在控制台中显示未定义。 这里我得到的数据是
**email:"gaurav1verve@gmail.com"
id:0
name:"Gaurav"
password:"tyh"**
和$ scope.Operator是一个包含三个字段的对象
$scope.Operator = {
Password: '',
Email: '',
Name: ''
};