2

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

2
  • what do you want to pass to function? scope variable, static variable...? Commented Mar 14, 2014 at 18:00
  • 1
    Thank you, Adam Zuckerman fixed my problem Commented Mar 14, 2014 at 18:05

1 Answer 1

4

You don't need the handlebars.

<input  type="button" ng-click="tableDelete(row.entity.id)" name="delete" value="Delete">
Sign up to request clarification or add additional context in comments.

3 Comments

OMG I'm going to kill my self. Thank you so much I've just lost so many time on this stupid thing :)
If you would mark it as the answer, I would be most appreciative.
yes sorry I had to wait 5 minutes (and I would vote up when I'll have more reputation ;) )

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.