I need to set the width of an HTML element at runtime from my controller in AngularJS. My controller is defined within my directive. I know that I need to set the width of the first ul
element within the directive. Currently, I have the following:
var list = $element.find('ul');
$element(list[0]).css('width', '300px'));
However, when I try this, I get an error that says:
TypeError: object is not a function
What am I doing wrong? How do I set the width of an HTML element at runtime in AngularJS?
Thank you!