I encountered the following issue:
Error message: Error trying to diff '[object Object]'. Only arrays and iterables are allowed
I have a JSON response that I want to utilize to display information like name, coordinates, temperature, minimum temperature, maximum temperature, and wind speed in the UI. In my code, I am attempting to display at least the name.
Json Data
{"cod":"200","calctime":0.3107,...// (additional JSON data omitted for brevity)
api.service.ts
import { Injectable } from '@angular/core';... // (API service code omitted for brevity)
app.component.ts
import { Component } from '@angular/core';... // (App component code omitted for brevity)
app.component.html
<ul *ngFor="let info of data">
<li>Name: {{ info.list.name }}</li>
</ul>
app.module.ts
import { NgModule } from '@angular/core';... // (App module code omitted for brevity)