This is how it is currently written
<li ng-repeat="data in datas"><a ng-click="handle($index)"></a></li>
I want to know how to write directly in the controller instead of passing parameters in HTML?
<button ng-click="onClick($event)">Button</button>
$scope.onClick = function(evt) { var index = $(evt.target).index(); //jquery }
Although I don’t understand what the questioner wants to ask, I usually write like this in this situation:
<li ng-repeat="data in datas"><a ng-click="handle(data,$index)"></a></li>
Although I don’t understand what the questioner wants to ask, I usually write like this in this situation: