我有loadAllUsers()函数:
function loadAllUsers(callback) {
UniversalService.GetAll()
.then(function (response) {
$scope.users=response;
if (callback) {
callback(response);
}
});
}
我在这里使用回复:
function setPage(page) {
loadAllUsers(function (response) {
if (response) {
if (page < 1 || page > vm.pager.totalPages) {
return;
}
console.log(response);debugger;
console.log(response.name);debugger;
// get pager object from service
vm.pager = PagerService.GetPager(10, page);
// get current page of items
vm.items = response.slice(vm.pager.startIndex, vm.pager.endIndex + 1);
}
});
}
当我打印console.log(response)
时,我得到了:
Object
email:"r@gmail.com"
id:2
name:"ss"
review:"sdvds"
surname:"dsv"
但是当我尝试打印console.log(response.name)
时,我得到了不确定。是否有可能以某种方式访问它?