You can apply a class conditionally like so:
<div ng-repeat="animal in animals">
<input type="checkbox" ng-model="animal.isHungry" ng-class="{'when-condition-true': animal.isHungry}">
</div>
The class when-condition-true
will be applied when the isHungry
attribute of the current animal
is truthy in the controller.
Alternatively can also switch a class conditionally like so:
<div ng-repeat="animal in animals">
<input type="checkbox" ng-model="animal.isHungry" ng-class="animal.isHungry ? 'when-condition-true' : 'when-condition-false'">
</div>
Both of these will work on page load and don't need interaction from your users. But when they do check and uncheck your classes will be added or removed automatically.