【发布时间】:2017-04-20 01:41:23
【问题描述】:
好的,我有这个
{ "calledCust": { "no": 270, "yes": 9 }, "hasOpened": { "no": 254, "yes": 25 } }
我一直在尝试将其显示在视图中。
<ul *ngFor="let profile of profiles.counts">
<li>
{{profile | json}}
</li>
</ul>
因为它不是一个 json 数组,所以 angular 会爆炸
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
我真的很想将结果显示如下。
- 叫客户是:9
- 已打开 YES:25
非常感谢
编辑
这是完整的 json
{
total_rows: 279,
bookmark: "g2wAAAABaANkAB5kYmNvcmVAZGI0LnBvcnRlci5jbG91ZGFudC5uZXRsAAAAAmEAYj____9qaAJGQAnZi4AAAABiAAAB7mo",
rows: [],
counts: {
calledCust: {
no: 270,
yes: 9
},
hasOpened: {
no: 254,
yes: 25
}
}
}
【问题讨论】:
-
对象内部的
countsprop 是什么? -
@PankajParkar 我已经编辑了这个问题,谢谢:)
标签: arrays json angular couchdb