consider the following table :
<tbody data-ng-repeat="job in jobs">
<tr>
<td>{{job.fileName}}</td>
<td>
<button class="btn" ng-click="deleteJob($index);"><i class="icon-delete"></i> delete</button>
</td>
</tr>
</tbody>
if I delete a job, the row id is passed to the function and it works just fine.
scope.deleteJob = function (id) {
scope.jobs.splice(id, 1);
}
However if I change deleteJob($index) to deleteJob({{$index}}) then, the index is still passed to the function, however if I delete row 1, the index of row 2 remains 2 and it is not updated.
How come ? What's the difference between the two approaches ?