l am try to get weather data json for wunderground api using ionic 4 . When l try to run this code l got error ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
short json response
{
"hourly_forecast": [
{
"condition": "غائم جزئياً",
"icon": "partlycloudy",
"icon_url": "http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "30"
}
]
}
code
weather : any
constructor(private https: HttpClient) {
this.https.get('xxxxxxxxxxxx/q/muscat.json')
.subscribe(data => {
this.weather= data
console.log(this.weather)
})
}
html
<tr *ngFor="let item of weather">
<td>{{item.hourly_forecast.condition}}</td>
</tr>
any idea please ?