Not able to identify last item in list slightly
Hi
I have the Sling model in that i have list like below
public List<customList> getCustomProducts() {
return customProducts;
}
When i tried to identify the last item of list like below
<sly data-sly-list.product="${productModel.customProducts}">
<a href="${product.link}"><strong> ${product.name}</strong> </a>
<sly data-sly-test="${!product.last}">
<span class="separator">|</span>
</sly>
</sly>
in above code <span class="separator">|</span> is printing for last item as well
if list contains 3 items the | should print 2 times like below
product1 | product2 | product 3
But its printing like
product1 | product2 | product 3 |
can some help me how to identify the last item from list so that or how i can achieve this