I think this is a job for...nsTemplateKey
<ListView [items]="items" class="list-group" [itemTemplateSelector]="templateSelector" row="0">
<ng-template nsTemplateKey="regular" let-item="item" let-i="index">
<GridLayout (tap)="regularAction()">
<Label [text]="item.name" backgroundColor="red" color="white"></Label>
</GridLayout>
</ng-template>
<ng-template nsTemplateKey="margin" let-item="item" let-i="index">
<GridLayout marginBottom="50" rows="auto, *">
<Label row="0" (tap)="innerClick()" [text]="item.name" backgroundColor="green" color="yellow"></Label>
<Label row="1"><Label>
</GridLayout>
</ng-template>
Now we just require the last item to have special params and options:
templateSelector(item, index: number, items: any) {
return index < items.length -1 ? "regular" : "margin";
}
I think this is a nice way to do this, now you can also use isPassThroughParentEnabled and isUserInteractionEnabled with your current code, you will have to play a lil bit with all this options and find the best solution for you, cheers.
<ListView [items]="items" class="list-group"
backgroundColor="red" separatorColor="blue">
<ng-template let-item="item">
<GridLayout height="60" isPassThroughParentEnabled="!isLast">
<Label (tap)="action" isUserInteractionEnabled="!isLast"[text]="item.name" class="list-group-item" color="white"></Label>
</GridLayout>
</ng-template>