Top "Ng-class" questions

The angularjs ngClass directive allows you to set CSS classes on an HTML element, dynamically, by databinding an expression that represents all classes to be added.

How can I change the background-color using ng-class?

I am trying to change the background color whenever someone inputs a '5' while using ng-class. I am really …

javascript css angularjs angularjs-ng-repeat ng-class
angular ng-class does not react on click

I am trying to use ng-class and bind a class to an expression so, that I can unit test the …

javascript angularjs ng-class
ng-class with function and Expression

I need to add two classes by using ng-class ,one class I am getting by a function another I need …

angularjs ng-class
How do I compare with a string in ng-class?

This line doesn't seem to work for me. Sort By: <a href="" ng-click="setOrder('title')" ng-class="{active: orderProp == 'title'}"&…

angularjs ng-class
Add multiple classes with ng-class, where one of the classes is conditional

I got this code: ng-class="{selectedHeader: key == selectedCol}" It works but I would like too add the 'key' value as …

angularjs ng-class
Ng-class - remove a class after it is added to the DOM

I am using animate.css to make animation on the same element. I am having a problem in removing the …

javascript css angularjs ng-class
Angular 2 ngClass conditional with data?

So I am basically trying to set a highlight if an object is selected already. How can I compare the …

css angular conditional ng-class
Conditionally set Angular's ng-class based on state

I would like to conditionally set the class of an element based on the application state (using AngularUI Router). I've …

angularjs angular-ui-router ng-class
Array in NgClass with method call and variable

I want to use [ngClass] with a method call that returns an object like {currentWeek: true} and I want to …

angular ng-class
Angular 2 add value to ngClass with interpolation

Lets say I have some objects in an array (lets call the array "items") like { title: "Title", value: true } and …

angular ng-class