NgStyle

Stable

Directive

What it does

Update an HTML element styles.

How to use

<some-element [ngStyle]="{'font-style': styleExp}">...</some-element> <some-element [ngStyle]="{'max-width.px': widthExp}">...</some-element> <some-element [ngStyle]="objExp">...</some-element>

Class Overview

class NgStyle implements DoCheck {
constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer)

ngStyle 
ngDoCheck()

}

Selectors

[ngStyle]

Class Description

Constructor

constructor(_differs: KeyValueDiffers, _ngEl: ElementRef, _renderer: Renderer)

Class Details

exported from @angular/common/index, defined in @angular/common/src/directives/ng_style.ts