Dynamic class in Angular.js
You can simply assign a function as an expression and return proper class from there. Edit: there is also better solution for dynamic classes. Please see note below. Snippet from view: <div ng-class=”appliedClass(myObj)”>…</div> and in the controller: $scope.appliedClass = function(myObj) { if (myObj.someValue === “highPriority”) { return “special-css-class”; } else { return “default-class”; // Or … Read more