In my code, I did
element.attr('class', element.attr('class') + ' state-active');
and the class .state-active got added to the element.
But when I try
element.addClass('state-active');
nothing happens.
It doesn't work, doesn't matter if I get the element with any of those:
var element = $('.state');
var element = angular.element($('.state'));
var element = angular.element($('.state')[0]);
I tried everything I could imagine, but none was enough. I noticed that .css() doesn't work either.
What could cause this issue and how do I solve this? For now my code is working, but that solution is not elegant...