How could i populate the HTML with simple JSON like:
{
"id": 34,
"name": "Tip 33",
"description": "Tip description 33",
"created_at": "2018-01-26 18:59:19",
"updated_at": "2018-01-26 18:59:19"
}
I used the code as:
<ion-content>
<ion-card *ngFor="let data of searchResults">
<ion-card-header>
{{data.name}}
</ion-card-header>
<ion-card-content>
{{data.description}}
</ion-card-content>
</ion-card>
</ion-content>
But I get this error as :
Error: Cannot find a differ supporting object '[object Object]' of type 'Tip 33'. NgFor only supports binding to Iterables such as Arrays.
My Code to fetch json is :
this.apiService.getCareerDescription(data).retry(3)
.subscribe(data => {
console.log(data);
this.loading.dismiss();
this.searchResults = data;
//let obj = JSON.parse(this.searchResults);
//console.log(obj);
console.log(this.searchResults);
;
}, (err) => {
this.loading.dismiss();
}
);
please help