i tried to show list value, when i console log value of list that's exactly like i want, like this
unit value {id: 81, name: "3 BR Suite"}
unit value {id: 82, name: "3 BR Grande"}
unit value {id: 83, name: "Pool Villa"}
unit value {id: 84, name: "Penthouse"}
but when i tried, to show it in html, there is error "Error trying to diff 'Penthouse'. Only arrays and iterables are allowed"
this is my .ts code
private unitList: any = [];
getUnit() {
this.oppCtrl.token_promise.then(() => {
this.oppCtrl.getUnitType(this.productID).subscribe(response => {
response.forEach(data => {
this.unitList = data;
console.log("unit value", this.unitList);
},);
},
(err) => {
let error = err.json();
this.globalService.toastInfo(error.message ? error.message : 'Failed, please check your internet connection...', 3000, 'bottom');
console.log(err);
})
})
}
this is my html code
<ion-card *ngFor="let item of unitList" (click)="save(item.id, item.name)">
<ion-list>
<button ion-item style="border-bottom: none !important; padding-bottom: 0px; padding-left: 10px;">
<ion-grid no-padding>
<ion-row>
<ion-col text-left col-12>
<p class="sourceList">{{item.name}}</p>
</ion-col>
</ion-row>
</ion-grid>
</button>
</ion-list>
can you guys help me how to solve it? thank you soo much