I've tried this however it has never worked. Any particular reason why, or examples of this working? I'm thinking: ng-click="myFunction('test')"
1 Answer
Sure, that works.
<a ng-click="myName('jz')">Click me</a>
Here is a simple example:
2 Comments
Aitazaz Khan
but how about this <a ng-click="myName({{x.id}})">Click me</a> will it work or not
jszobody
There's no need for the curly braces. You are already calling an angular controller method, just pass in the argument without braces:
myName(x.id)