3
我得到我的$資源GETALL()作爲
[$promise: Object, $resolved: false]
0: Resource
1: Resource
$promise: Object
$resolved: true
length: 2
__proto__: Array[0]
和我使用的是服務數據對象其保存爲
this.datas = [];
this.nestedData = [];
this.setdata = function(datas) {
this.datas = datas;
console.log(this.datas); // get data as mentioned above
console.log(this.datas.length); // here i get length as 0
for(var i=0;i < datas.length; i++) {
this.nestedData.push(datas[i].nested);
}
};
爲什麼我的長度爲0?如何解決這個問題?