You did not have the correct ng-class syntax, it must be in JSON format, for example ng-class="{'used': expression2 }" , the expression will return a Boolean based on this class, which will be added or removed from the value of the attribute class.
As your getFieldClass method returns the class name, then you can transfer your class logic to the getFieldClass method
Markup
<div class="field-icon" ng-class="getFieldClass(entry)" ></div>
code
$scope.getFieldClass = function(entry){ //use entry.entry_type_id here to decide class which is first //'text-box-icon' class has been selected on some condition based on entry.entry_type_id return {"text-box-icon": true, 'used': $scope.entry_map[entry.guid] > 0}; }
source share