4

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

0

1 Answer 1

9

Sure, that works.

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

Here is a simple example:

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

Sign up to request clarification or add additional context in comments.

2 Comments

but how about this <a ng-click="myName({{x.id}})">Click me</a> will it work or not
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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.