How can I assign ng-click to $first element in ng-repeat? In the code below, doSomething() should only be called when you click on the first input. The rest of the inputs should not have ng-click handlers assigned. I found examples of using $first with an ng class or ng-show, but not with ng-click.
<div ng-repeat="item in items"> <input type="checkbox" ng-click="doSomething()"/>{{item.name}} </div>
source share