AngularJS, difference between ng-class and class with angular expression? AngularJS, difference between ng-class and class with angular expression? angularjs angularjs

AngularJS, difference between ng-class and class with angular expression?


With the first example before angular loads your class will literally be "{{getClass()}}". While in the second example the div won't have a class until angular runs its first digest.

There might be some minor differences with when they are recalculated but Angular will keep both up to date. I've run into issues before using the first method with Animation as ng-class has some hooks into animation.