In my HTML I have a table:
<table>
<tr ng-class="vm.status" ng-repeat="item in vm.itemsList">
<td>{{ item.name }}</td>
<td>
{{ item.description }} - <span ng-click="vm.disableRow()">Disable</span>
</td>
</tr>
</table>
What I'm trying to accomplish is that when I click on Disable, I want to apply the class "disabled" to that specific tr only.
My current code applies that class to the entire table. I have other options such as remove that successfully removes the tr by using splice and $index.
I wondered if I need to implement $index to add class too but I can't think of how to do it.
In my controller:
vm.disableRow = function() {
vm.status = 'disabled';
}
If it matters, I need to only click once to apply that 'disabled' class. Once its disabled, I cannot change it so no need for a toggle on or off option.