Я пытаюсь получить данные о погоде в формате json для wunderground API, используя ionic 4. Когда я пытаюсь запустить этот код, я получаю ошибку ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
короткий ответ json
{
"hourly_forecast": [
{
"condition": "غائم جزئياً",
"icon": "partlycloudy",
"icon_url": "http://icons.wxug.com/i/c/k/partlycloudy.gif",
"fctcode": "2",
"sky": "30"
}
]
}
код
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>
Любая идея, пожалуйста?