Reputation: 75
An ObservableArray
works fine with <ListView [items]="feedsComments"
, where feedsComments
is an ObservableArray
in NativeScript.
But when I replace the ListView
with the following:
<StackLayout *ngFor="let item of feedsComments">
</StackLayout>
It throws the following error:
ERROR Error: Cannot find a differ supporting object '[object Object],[object Object]' of type 'object'.
NgFor only supports binding to Iterables such as Arrays.
Upvotes: 0
Views: 752
Reputation: 233
<StackLayout *ngFor="let item of feedsComments._array" height="100" width="100">
<Label [text]="item.someField"></Label>
</StackLayout>
Ugly, but it works. Seems that the class can do with a getItems() method. There is a getItem(i) though to get a specific item in the array.
Upvotes: 1