WellWellWell
WellWellWell

Reputation: 161

AngularJS ng-click with parameters

I have this line of code :

<input  type="button" ng-click="tableDelete()" name="delete" value="Delete">

and in tableDelete(), I would like to put a parameter : {{row.entity.id}} (the id of the button where I click in an array)

The problem is that if I put it like this, when I call my function tableDelete(var), var is undefined...

So here is my question : how can we pass parameters to a function through ng-click ?

Thank you

Upvotes: 2

Views: 1756

Answers (1)

Adam Zuckerman
Adam Zuckerman

Reputation: 1641

You don't need the handlebars.

<input  type="button" ng-click="tableDelete(row.entity.id)" name="delete" value="Delete">

Upvotes: 4

Related Questions