title: Displaying object in html and getting : "NgFor only supports binding to Iterables such as Arrays"
body: <p>I got this json from rest api call</p>
  
  <pre><code>{"items":[{"id":"1","name":"Adam","age":20},{"id":"2","name":"Cris","age":32}]}
  </code></pre>
  
  <p>From Api I got an object UserResult which contains list of specific users objects. 
  I would like to display in html file values for all user objects -  names for every user. </p>
  
  <pre><code>&lt;div&gt;
      &lt;ng-container *ngFor="let name of user"&gt;
          &lt;div&gt;
              &lt;span&gt;{{user.name}}&lt;/span&gt;
          &lt;/div&gt;
      &lt;/ng-container&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My data.service looks like: </p>
  
  <pre><code>
  @Injectable({
    providedIn: 'root'
  })
  export class DataService {
  
    constructor(private httpClient: HttpClient) { }
  
    public getUsers(): Observable&lt;UserResult&gt; {
      return this.httpClient.get&lt;UserResult&gt;(baseUrl);
    }
  }
  
  </code></pre>
  
  <p>and component.ts looks like this: </p>
  
  <pre><code>export class SidebarComponent implements OnInit {
    users: UserResults;
  
  
    constructor(private dataService: DataService) { }
  
    ngOnInit(): void {
      this.getUsers();
    }
  
    private getUsers() {
      this.dataService.getUsers().subscribe(
        data =&gt; {
          this.users = data;
        }
      )
    }
  }
  </code></pre>
  
  <p>As I understand from this error I can not display values for specific object the way I try. </p>
  
  <pre><code> ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
  
  </code></pre>
  
  <p>Should I create let's say an array with type User and then try to display in html every single user?</p>
  
  <p>Map my api response from UserResults to <code>users:User[]</code> ? 
  Or is there other way to do it? </p>