3

Angular 1.5

I am trying to pass noteNumber into a function call in ng-click.

How is that bound? This is in error.

    <span ng-repeat="noteNumber in row.Notes">
        <a href="#" ng-click="showNote({{noteNumber}})">{{noteNumber}}</a><span ng-show="!$last">,&nbsp;</span>
    </span>
1
  • your mistake are on the param of your method or event , not set with {{}} the object , set like simple variable Commented Feb 26, 2016 at 21:53

2 Answers 2

7

Use ng-click="showNote(noteNumber)" and you'd be fine!

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

Comments

1

You don't need to use the {{}} markup in ng-click - both the function and any arguments you pass it are assumed to be part of whatever the scope is when that template is loaded. So:

ng-click="showNote(noteNumber)"

Comments

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.