Reputation: 3890
In JavaScript one can change class of an element like this
document.getElementById("MyElement").className = "MyClass";
What is the alternative for doing something similar in AngularJS function? I am getting an element by using
var myElement = angular.element( document.querySelector( '#MyElement' ) );
now is there any way to change class of var myElement
? or is it possible to do something similar to myElement.style
?
Upvotes: 0
Views: 251
Reputation: 16341
Angular provides a jqLite implementation of jQuery. There are also funcitons available like
Full spec: http://docs.angularjs.org/api/angular.element
Upvotes: 2