# HTTP Service And Repeat - NgFor only supports binding to Iterables such as Arrays

**URL:** <https://forum.ionicframework.com/t/http-service-and-repeat-ngfor-only-supports-binding-to-iterables-such-as-arrays/77708>\
**Category:** ionic-v3\
**Created:** [January 28, 2017, 10:21pm UTC](https://forum.ionicframework.com/t/http-service-and-repeat-ngfor-only-supports-binding-to-iterables-such-as-arrays/77708 "2017-01-28T22:21:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrdd94](https://avatars.discourse-cdn.com/v4/letter/l/b4bc9f/32.png) [@lrdd94](https://forum.ionicframework.com/u/lrdd94)\
**Post date:** [January 28, 2017, 10:21pm UTC](https://forum.ionicframework.com/t/http-service-and-repeat-ngfor-only-supports-binding-to-iterables-such-as-arrays/77708/1 "2017-01-28T22:21:51Z")

</div>

Hey all, firstly sorry for my bad english.  
Im trying get data from api and list, but when i try it, ionic get this error:

Cannot find a differ supporting object ‘[object Object]’ of type ‘object’. NgFor only supports binding to Iterables such as Arrays.

This is my code:

Home.ts

```
this.api.getTest().then(success =>{
            this.users = success;
            console.log(this.users);
            loader.dismiss();
});

```

API Provider

```
getTest() {
    return new Promise((resolve) => {

      this.http.get('https://randomuser.me/api/?results=10')
      .map(res => res.json())
      .subscribe(data => {
        this._data = data.results;
        resolve(this._data);
      });
    })
  }

```

`<ion-item text-wrap *ngFor="let user of users">`

If anyone can help me,  
Thanks

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [January 28, 2017, 11:55pm UTC](https://forum.ionicframework.com/t/http-service-and-repeat-ngfor-only-supports-binding-to-iterables-such-as-arrays/77708/2 "2017-01-28T23:55:01Z")

</div>

It would help to see what is being logged in the console, to know what is being returned.

`getTest()` does not need to be creating promises, and in fact does not propagate errors correctly as written. Do it this way instead:

```auto
getTest(): Observable<User[]> {
  return this.http.get('url').map((rsp) => {
    return extractUsersFromResponse(rsp);
  });
}

this.api.getTest().subscribe((users) => {
  this.users = users;
});

```

What `extractUsersFromResponse` looks like depends on what the backend is sending you.
