AngularJS ng-style with a conditional expression. If you using angular < 1.1.5, then you can use ng-class to ng-style with a conditional expression.
1 2 3 4 5 6 7 8 9 10 11 |
.largeWidth { width: 100%; } .smallWidth { width: 0%; } // [...] ng-class="{largeWidth: myVar == 'ok', smallWidth: myVar != 'ok'}" |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.