Improve this Doc View Source ngStyle
- directive in module ng
ngStyle directive allows you to set CSS style on an HTML element conditionally.
- This directive executes at priority level 0.
- as attribute:
<ANY ng-style="expression"> ... </ANY>
- as CSS class:
<ANY class="ng-style: expression;"> ... </ANY>
|ngStyle|| || |
Expression which evals to an object whose keys are CSS style names and values are corresponding values for those CSS keys.
Since some CSS style names are not valid keys for an object, they must be quoted. See the 'background-color' style in the example below.
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.