Reputation: 10079
I'm performing listview item button onclick. Below is the code I tried so far.When clicking on the button its not triggered console log.
I don't know what was the issue here.
html file:
<ListView [items]="items" class="list-group">
<ng-template let-item="item">
<GridLayout rows="auto" columns="*, auto">
<Label [nsRouterLink]="['/item', item.id]" [text]="item.name" row="0" col="0" class="list-group-item"> </Label>
<Button text = "Install" tap ="onTap($event)" row="0" col="1" > </Button>
</GridLayout>
</ng-template>
</ListView>
ts file:
onTap(args: EventData) : void{
let button = <Button>args.object;
console.log("First", "Test");
})
}
Upvotes: 0
Views: 515
Reputation: 13356
Try changing this ...
<Button text = "Install" tap ="onTap($event)" row="0" col="1" > </Button>
Into this ...
<Button text = "Install" (tap) ="onTap($event)" row="0" col="1" > </Button>
Upvotes: 3