angular_analyzer_plugin
angular_analyzer_plugin copied to clipboard
Support binding to style
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.
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