angular.directive.ng:style

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

The ng:style allows you to set CSS style on an HTML element conditionally.

Dependencies

Usage

<ANY ng:style="expression">
   ...
</ANY>

Parameters

Example

<input type="button" value="set" ng:click="myStyle={color:'red'}"> <input type="button" value="clear" ng:click="myStyle={}"> <br/> <span ng:style="myStyle">Sample Text</span> <pre>myStyle={{myStyle}}</pre>