angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Support binding to style

Open MichaelRFairhurst opened this issue 8 years ago • 1 comments

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 a String or one of those SomeStyleThing classes.

MichaelRFairhurst avatar Sep 05 '17 19:09 MichaelRFairhurst

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

zoechi avatar Sep 06 '17 07:09 zoechi