$scope.toggleButton = { inAddState: true };
$scope.update = (id, button) => {
if (button.inAddState) {
// logic to add
} else {
// logic to remove
}
// make sure you switch the state of the button at some point
button.inAddState = !button.inAddState;
}
<button ng-click="update(data.id, toggleButton)"
class="btn {{ toggleButton.inAddState ? 'btn-primary' : 'btn-warning' }}"
ng-bind="toggleButton.inAddState ? 'Add' : 'Remove'">
</button>