.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();
postman:
{
"result": [
{
"id": "KT5c6wdb8ecd94e",
"name": "Need Batteries"
},
{
"id": "RT5c6aa12600134",
"name": "A/C Not working"
}
]
}
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays. at NgForOf.push../node_modules/@angular/common/fesm5/common.js.NgForOf.ngDoCheck (common.js:3161) at checkAndUpdateDirectiveInline (core.js:22004) at checkAndUpdateNodeInline (core.js:23265) at checkAndUpdateNode (core.js:23227) at debugCheckAndUpdateNode (core.js:23861) at debugCheckDirectivesFn (core.js:23821) at Object.eval [as updateDirectives] (MaintenancePage.html:19) at Object.debugUpdateDirectives [as updateDirectives] (core.js:23813) at checkAndUpdateView (core.js:23209) at callViewAction (core.js:23450)
Can you tell me the issue here?
resulton the returned type:let t of (issueTypes$ | async)?.result; let i = index