1
命名交物业我得到“postrows”列表下面的代码获取restangular
$scope.postrows = {};
Restangular.all('/postrows').getList().then(function(data){
$scope.postrows = data;
});
被返回的样子
{
id: 1,
post: {
id: 1,
postcategory: 1,
account: "0005",
description: "Grond",
sequence_number: 1
},
amount: 2343.56,
},
的JSON但是,当我环槽的项目列表:
angular.forEach($scope.postrows, function(postrow) {
console.log(postrow);
console.log(postrow.post);
}
而且要检索例如postrow.post
我收到post
功能从restangular。我怎样才能得到像在json文件中那样的post
对象。
我不允许将名称post
更改为其他名称。
你用来循环使用的代码在哪里? – tkone
刚刚编辑的问题。 –
当您登录时,'postrow'看起来像什么?它是否包含您期望的'post'属性? 'console.log(postrow)'的结果是什么' – tkone