# Cannot find a differ supporting object '\[object Object\]'

**URL:** <https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776>\
**Category:** ionic-v3\
**Created:** [July 11, 2017, 6:55pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776 "2017-07-11T18:55:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![randolphrrl](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@randolphrrl](https://forum.ionicframework.com/u/randolphrrl)\
**Post date:** [July 11, 2017, 6:55pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776/1 "2017-07-11T18:55:22Z")

</div>

Hello!

I’m new to Ionic and I’m having trouble querying my API. Console.log information arrives normally, but I can not display the data in home.html. I will send the error code and my query code. Could you help me with this consultation?

Error:

```auto
Runtime Error
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.

```

Result console.log

![image](https://global.discourse-cdn.com/ionicframework/original/3X/f/6/f6a00cbccd1ecb27d53b6835feafa3f218c91cbd.png)

Providers:

```auto
import { Injectable } from '@angular/core';
import { Http, RequestOptions, Headers } from '@angular/http';
import 'rxjs/add/operator/map';

@Injectable()
export class ServerHttpService {
  data: any;

  apiUrl = 'http://localhost/api/v1';

  constructor(public http: Http) {
    console.log('Hello ServerHttpService Provider');
  }

getUsers() {
  if (this.data) {
    return Promise.resolve(this.data);
  }

  return new Promise(resolve => {

    let myHeader = new Headers({
      "Accept": "application/vnd.api+json",
      "Content-Type": "application/vnd.api+json",
      "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjIsImV4cCI6MTUwMDMxODE0OH0.O3vHmSW5Crn0b3BlHO7XSUII6IswOgICtKC13a3aO5g"
    });

    let options = new RequestOptions({
      headers: myHeader
    });
    
    this.http.get(this.apiUrl+'/servidores', options)
      .map(res => res.json())
      .subscribe(data => {
        
        this.data = data;
        resolve(this.data);
      });
  });
}

}

```

Home.ts:

```auto
import { Component } from '@angular/core';
import { NavController, AlertController } from 'ionic-angular';
import { Login } from './../login/login';
import { Info } from './../info/info';
import { ServerHttpService } from './../../providers/server-http-service';
import { LoginServiceProvider } from './../../providers/login-service/login-service';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})

export class HomePage {
  users: any;

  constructor(
    public navCtrl: NavController,
    public alertCtrl: AlertController,
    public serverHttpService: ServerHttpService,
    public loginServiceProvider: LoginServiceProvider) {

    serverHttpService.getUsers().then(data => {
      console.log(data);
      this.users = data;
    });

  }

}

```

Home.html:

```auto
<ion-header>
  <ion-navbar color="principal">
    <ion-title>
      Dashboard
    </ion-title>
    <ion-buttons end>
      <button ion-button (click)="showConfirm()">
          <ion-icon name="exit"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content padding>

  <ion-list *ngFor="let user of users">
    <ion-item>
      <ion-thumbnail item-start>
        <img src="{{user.logo}}">
      </ion-thumbnail>
      <h2>{{user.nome}}</h2>
      <p>{{user.ippublico}}</p>
    </ion-item>
  </ion-list>

</ion-content>

```

---

<div class="post-metadata">

**Author:** ![sprasad02](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@sprasad02](https://forum.ionicframework.com/u/sprasad02)\
**Post date:** [July 11, 2017, 9:21pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776/2 "2017-07-11T21:21:02Z")

</div>

Can you try changing “users: any;” to “users: any = []” in Home.ts file

---

<div class="post-metadata">

**Author:** ![randolphrrl](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@randolphrrl](https://forum.ionicframework.com/u/randolphrrl)\
**Post date:** [July 11, 2017, 9:46pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776/3 "2017-07-11T21:46:34Z")

</div>

Hello Friend! Thanks for the answer.

I made the change as you taught me, but it showed a different error from the previous one, I’ll show it to you

Error:

```auto
Runtime Error
Error trying to diff '[object Object]'. Only arrays and iterables are allowed

```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 11, 2017, 10:33pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776/4 "2017-07-11T22:33:31Z")

</div>

`users` has to be an array (`[]`), you have an object (`{}`) right now. Find a way to put the users into an array. Add console.log directly after you get the data so you know what it looks like, then find a good place to transform it and check with more logging that you now have an array.

---

<div class="post-metadata">

**Author:** ![MockeryLV](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@MockeryLV](https://forum.ionicframework.com/u/MockeryLV)\
**Post date:** [February 12, 2019, 6:04pm UTC](https://forum.ionicframework.com/t/cannot-find-a-differ-supporting-object-object-object/97776/5 "2019-02-12T18:04:30Z")

</div>

I love you so much!!!
