MyTimeFinder
MyTimeFinder

Reputation: 1807

Angular ng-click won't fire if angular {{model}} is included as parameter

I would think this is fairly straight forward, but if I try to include a bound {{data}} model as a parameter in ng-click, nothing happens (an no error is fired in Console).

For example, I have the following:

<p ng-repeat='item in array'>
  <a ng-click='function({{item}})'></a>
</p>

Here is a plunker that is more fleshed out: plunker

If I click on the link, nothing happens. Ideas?

Upvotes: 1

Views: 232

Answers (1)

MyTimeFinder
MyTimeFinder

Reputation: 1807

Found my own answer:

within ng-click, there is no need for the {{notation}}. It knows that "item" is an angular data model. Again, not super clear in the Angular documentation.

Here is the updated plunker that shows it working and not working.

Upvotes: 1

Related Questions