![](/img/trans.png)
[英]angular 2 NgFor only supports binding to Iterables such as Arrays
[英]NgFor only supports binding to Iterables such as Arrays in Ionic3
您可以使用 ES6 的 Object.values 來獲取值數組:
var obj = { "1": { prop: "xxx" }, "2": { prop: "yyy" }, "3": { prop: "zzz" } } var arr = Object.values(obj); console.log(arr);
我嘗試使用一種方法來獲取這樣的存儲離子對象數組:
this.storage.forEach((value: string, key: string, index: number) => {
//console.log(key);
console.log('value',value);
});
它返回一個對象數組,但帶有附加值! 奇怪..... 來自這里的解決方案
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.