p.location-badge. exported from angular2/directives defined in angular2/src/directives/ng_style.ts (line 7) :markdown 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 - `
` - `
` .l-main-section h2 Annotations .l-sub-section h3.annotation Directive pre.prettyprint code. @Directive({ selector: '[ng-style]', lifecycle: [LifecycleEvent.onCheck], properties: ['rawStyle: ng-style'] }) .l-main-section h2 Members .l-sub-section h3 constructor pre.prettyprint code. constructor(_pipes: Pipes, _ngEl: ElementRef, _renderer: Renderer) :markdown .l-sub-section h3 rawStyle :markdown .l-sub-section h3 onCheck pre.prettyprint code. onCheck() :markdown