Correct way to populate listView with object items?

允我心安 提交于 2019-12-02 08:00:53

You need the following syntax when using NativeScript + Angular-2 list-view:

<ListView [items]="fileItems">
    <template let-item="item">
        <StackLayout>
            <Label width="5%" height="5%" text="Type"></Label>
            <Label [text]="item.name"></Label>
        </StackLayout>
    </template>
</ListView>

For better understanding you can reffer to the sample-Groiceries angular-end branch here

And check the tutorial about NativeScript + Angular-2 ListView here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!