File tree Expand file tree Collapse file tree
modules/angular2/src/directives Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,29 @@ import {KeyValueChanges} from 'angular2/src/change_detection/pipes/keyvalue_chan
66import { isPresent , print } from 'angular2/src/facade/lang' ;
77import { Renderer } from 'angular2/src/render/api' ;
88
9+ /**
10+ * Adds or removes styles based on an {expression}.
11+ *
12+ * When the expression assigned to `ng-style` evaluates to an object, the corresponding element
13+ * styles are updated. Style names to update are taken from the object keys and values - from the
14+ * corresponding object values.
15+ *
16+ * # Example:
17+ *
18+ * ```
19+ * <div ng-style="{'text-align': alignEpr}"></div>
20+ * ```
21+ *
22+ * In the above example the `text-align` style will be updated based on the `alignEpr` value
23+ * changes.
24+ *
25+ * # Syntax
26+ *
27+ * - `<div ng-style="{'text-align': alignEpr}"></div>`
28+ * - `<div ng-style="styleExp"></div>`
29+ *
30+ * @exportedAs angular2/directives
31+ */
932@Directive ( { selector : '[ng-style]' , lifecycle : [ onCheck ] , properties : [ 'rawStyle: ng-style' ] } )
1033export class NgStyle {
1134 _pipe : Pipe ;
You can’t perform that action at this time.
0 commit comments