Open MichaelRFairhurst opened 7 years ago
There are two ways of binding to styles
[style.background-color]="'red'"
or
[ngStyle]="{'background-color': 'red', 'margin': 'solid 3px bue'}"
The classes CssStyleDeclarationBase
and CssStyleDeclaration
seem to list all style properties.
The properties in class CssStyleDeclaration
have annotations like @JSName('backgroundColor')
, but CssStyleDeclarationBase
doesn't have the these annotations.
See also
https://webdev.dartlang.org/angular/guide/template-syntax#!#other-bindings https://webdev.dartlang.org/angular/guide/template-syntax#!#ngStyle
Also handle security for it.
Not sure why it isn't a part of
dart:html
in a usable way, and I'm not sure if angular expects to get aString
or one of thoseSomeStyleThing
classes.