Hi Paul,
Thank you for contacting Syncfusion support.
We have checked your requirement and currently in ListView, Template is not using ngFor to generate its items. Since it is a custom compiler template, we have generated the items based on the given Values. We suggest you use below workaround solution for your requirement by using below response,
Code Example
<span class="e-list-item-header">index {{this.getIndex(data)}} - {{data.text}}</span>
getIndex(ds) {
return this.data.indexOf(ds);
}
getFirstElement() {
return this.data[0];
}
getLastElement() {
return this.data[this.data.length - 1];
} |
In ListView the data source is returned in array format so you can get first and last items data by passing first and last index position (0 and data.length-1) to data Source, and you can get the list item index position by passing the item data to indexOf method.
Could you please check the above sample and get back to us if you need any further assistance on this?
Regards,
Vinoth Kumar S