Recently, I decided to play around with AngularJS and now I seem to be facing a small issue with ng-class. Specifically, I'm attempting to change the color of an awesome font icon.
<div ng-controller="MyCtrl">
<i ng-class="{'test': item.active}" class="fa fa-bullhorn"></i>
I have a set of checkboxes that are bound to parameters using ng-model
<div class="checkboxes">
<form>
<span ng-repeat="item in items">
<input type="checkbox" ng-model="item.active"> {{item.name}}<br>
</span>
</form>
</div>
</div>
After clicking a checkbox, the scope reflects as:
[{"category":"category1","name":"Item1","active":true}]
Unfortunately, the i-element's class remains "fa fa-bullhorn".
The initial color is black, and the css class test is defined as:
.test{
color: red;
}
Any assistance would be greatly appreciated.