I have an element with two classes:
<div class="classe1 classe2">
</div>
I want to increase the width of my class 2 style, what would be the right way to do it?
I have an element with two classes:
<div class="classe1 classe2">
</div>
I want to increase the width of my class 2 style, what would be the right way to do it?
One of the correct ways to do this is to give the correct width to a new class, widthClass
(for example) and then make a ng-class
.
widthClass { width: 9000px }
<div ng-class="'widthClass': scope.needsMoreWidth" class="class1 class2"></div>
In your controller you will have something like:
$scope.needsMoreWidth = true;
If you want to apply width to all elements that apply to the class, in the "class2" case, at runtime, you can apply.
angular.element(".class2").width(500)