I got data like this in my console from my API:
[
{
id:"123",
name:"asd",
address:"st.dddss",
status:1
}
]
I call it using ngFor and I got this error:
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
But that still works and data is showing. This is my code:
this._service
.getHotelbyId(this.id)
.subscribe(hotel =>
{
this.Hotels = hotel
console.log(this.Hotels);
},
error =>
{
console.log(error);
})
And I call it like this using *ngFor
*ngFor="let z of Hotels
{{z.name}} , {{z.address}}
How to solve that error message?
console.log(this.Hotels- what is the output?