In my application I would like to have conditional based click event ,
0) {removeSelected(item.spId)}\" 相关标签:
(click)="idx > 0 && removeSelected(item.spId)"
Simply use a ternary:
<div class="trashIconDiv" (click)="idx > 0 ? removeSelected(item.spId) : false">
This will only call removeSelected function when the condition is true, if it's false then it won't do anything.
removeSelected