For some reason AngularJS does not fire off the event when {{$index}} is used in ng-click.
My html:
<div ng-controller="Ctrl">
<ul>
<li ng-repeat="foo in foos">
<label>{{foo.name}}</label>
<a href="#" ng-click="remove({{$index}})">X (doesnt work)</a>
<a href="#" ng-click="remove(0)">Remove first element (works)</a>
</li>
</ul>
</div>
jsfiddle: http://jsfiddle.net/Lcasg/3/
Anyone knows how to fix this? Thanks
The value of the ng-click attribute is evaluated as an angular expression, so simply use remove($index).