This is AngularJS 1.5 (not 2)
I have a <div>
tag that has a default classes and a class that is only applied on a variable value. I'm using ng-class to toggle the latter class mentioned.
Based on the same variable value, I'd like to toggle one of the attributes in the default class. I'm using ng-style to try and toggle this.
How do I know, or can I set, which class the ng-style interacts with? Or is there a different/better way to do this? I would like to keep the logic inline in the HTML, and not resort to editing classes in the Controller.
My HTML:
<div class="default-class"
ng-style="{flex-direction: Controller.isMobile() ? 'column-reverse' : 'row'}"
ng-class="{'sometimes-class': !Controller.isMobile()}">
...
</div>
CSS:
.default-class{
display: flex;
flex-direction: row; /*A default value that I expect to toggle*/
}
.sometimes-class{
...
}
I am trying to edit the flex-direction
value found in the default-class
.