For some reasons, I can\'t change the style of an element using the following :
angular.element(\"#element\").style.height = 100px;
I\'m su
According to the docs:
Note: all element references in Angular are always wrapped with jQuery or jqLite; they are never raw DOM references.
So the .style
property is not available directly, since it is a property of the wrapped HTMLElement.
You can either use ivarni's approach to get hold of the HTMLElement (angular.element(...)[0].style...
) or use jQuery's/jqLite's .css()
method:
angular.element('#element').css('height', '100px');