In angular, you can just access the element and change it's class. You can do way more things, like change it's properties too, but I think that working with classes is neater.
Then, you use add classes to the DOM using:
var myEl = angular.element( document.querySelector( '#div1' ) );
myEl.addClass('alpha');
Here you can find some ideas for it:
https://stackoverflow.com/a/30410490/5250103
Also, another good solution would be using conditional classes (ngClass):
https://stackoverflow.com/a/16529903/5250103
There he explains:
The ngClass directive will work with any expression that evaluates truthy or falsey, a bit similar to Javascript expressions but with some differences, you can read about here. If your conditional is too complex, then you can use a function that returns truthy or falsey, as you did in your third attempt.
An example given here
ng-class="{'test': obj.value1 == 'someothervalue' || obj.value2 == 'somethingelse'}"
I don't intend to steal any anwser, but as suggested in comments, this was edited and it is quoting it's authors.
I hope it helps!