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