Angular · Directive
ngStyle
NgStyle updates styles on its containing HTML element. Bind it to style key-value pairs, with optional unit suffixes such as .px; a null value removes that style.
Last updated
Syntax
class NgStyle implements DoCheck {
constructor(_ngEl: ElementRef<any>, _differs: KeyValueDiffers, _renderer: Renderer2);
@Input() set ngStyle(value: { [klass: string]: any } | null | undefined);
}In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
CommonModuleNgClassRenderer2KeyValueDiffersElementRef