Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to pass arguments to functions on AngularJS ng-click?

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')"

like image 870
brushleaf Avatar asked Jan 13 '23 17:01

brushleaf


1 Answers

Sure, that works.

<a ng-click="myName('jz')">Click me</a>

Here is a simple example:

http://jsfiddle.net/djYbC/1/

like image 163
jszobody Avatar answered Jan 17 '23 16:01

jszobody