Reputation: 95
I want to bind Angularjs data inside onClick
function,
I have tried, but it's not working.
In below example I want to bind index value inside onclick
function. What's wrong with my code. Can anyone point out this..
/**Example:**/
<input type="text" ng-repeat="items in itemList" onClick=tab("{{$index}}")
Upvotes: 0
Views: 424
Reputation: 5122
I've done ...
ng-click="tab($index)"
This takes advantage of the fact that angular has it's own click; this allows for simpler variable declaration and passing.
Upvotes: 3