【发布时间】:2019-07-27 05:28:55
【问题描述】:
.html
<ion-select-option value="t.result[i].id" *ngFor="let t of (issueTypes$ | async); let i = index ">
{{t.result[i].name}}
</ion-select-option>
.ts
this.issueTypes$ = this.maintenanceService.get();
邮递员:
{
"result": [
{
"id": "KT5c6wdb8ecd94e",
"name": "Need Batteries"
},
{
"id": "RT5c6aa12600134",
"name": "A/C Not working"
}
]
}
错误错误:找不到不同的支持对象“[object Object]” '对象'类型。 NgFor 仅支持绑定到 Iterables,例如 数组。 在 NgForOf.push../node_modules/@angular/common/fesm5/common.js.NgForOf.ngDoCheck (common.js:3161) 在 checkAndUpdateDirectiveInline (core.js:22004) 在 checkAndUpdateNodeInline (core.js:23265) 在 checkAndUpdateNode (core.js:23227) 在 debugCheckAndUpdateNode (core.js:23861) 在 debugCheckDirectivesFn (core.js:23821) 在 Object.eval [as updateDirectives] (MaintenancePage.html:19) 在 Object.debugUpdateDirectives [as updateDirectives] (core.js:23813) 在 checkAndUpdateView (core.js:23209) 在 callViewAction (core.js:23450)
你能告诉我这里的问题吗?
【问题讨论】:
-
您可能在返回的类型上指的是
result:let t of (issueTypes$ | async)?.result; let i = index
标签: angular typescript rxjs angular7 ionic4