I am currently developing an app using nativescript and angular 2. I am facing some issues while trying to implement the nativescript listview component. Whenever I run the app, all I see is " [object object] ".
Below is my view code :
<grid-layout columns="*" rows="*">
<ListView [items]="itemsd" class="listview" #LISTV>
<ListView.itemTemplate>
<grid-layout columns="50, *" rows="*" class="item item-avatar">
<image src="{{ '~/images/' + img }}" col="0"></image>
<stack-layout col="1">
<label text="{{ artist }}" class="h2" col="1"></label>
<label text="{{ title }}" class="p" col="1"></label>
</stack-layout>
</grid-layout>
</ListView.itemTemplate>
</ListView>
</grid-layout>
This is my typescript code :
ngOnInit(): void {
this.fakeListItems = [{
"img":"ANDY.jpg",
"artist":"ANDY",
"title":"A User"
}]
this.itemsd = new ObservableArray(this.fakeListItems);
}
I have tried multiple ways to resolve the issue with the listview component, however, due to unclear documentation and various versions from different sources, I am unable to find a solution. Can someone please guide me on how to make it work properly?
Thank you.