diff --git a/modules/angular2/src/directives/ng_style.ts b/modules/angular2/src/directives/ng_style.ts index 61be845d5f..a3f18c5372 100644 --- a/modules/angular2/src/directives/ng_style.ts +++ b/modules/angular2/src/directives/ng_style.ts @@ -6,6 +6,29 @@ import {KeyValueChanges} from 'angular2/src/change_detection/pipes/keyvalue_chan import {isPresent, print} from 'angular2/src/facade/lang'; import {Renderer} from 'angular2/src/render/api'; +/** + * Adds or removes styles based on an {expression}. + * + * When the expression assigned to `ng-style` evaluates to an object, the corresponding element + * styles are updated. Style names to update are taken from the object keys and values - from the + * corresponding object values. + * + * # Example: + * + * ``` + *
+ * ``` + * + * In the above example the `text-align` style will be updated based on the `alignEpr` value + * changes. + * + * # Syntax + * + * - `` + * - `` + * + * @exportedAs angular2/directives + */ @Directive({selector: '[ng-style]', lifecycle: [onCheck], properties: ['rawStyle: ng-style']}) export class NgStyle { _pipe: Pipe;