Update an HTML element styles.
<some-element [ngStyle]="{'font-style': styleExp}">...</some-element> <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> <some-element [ngStyle]="objExp">...</some-element>
class NgStyle implements DoCheck { constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer) ngStyle ngDoCheck() }
[ngStyle]
The styles are updated according to the value of the expression evaluation:
.<unit>
suffix (ie 'top.px', 'font-style.em'),constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer)
ngStyle
ngDoCheck()
exported from @angular/common/index, defined in @angular/common/src/directives/ng_style.ts
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/common/index/NgStyle-directive.html