Using Typescript & Angular 2.0.0-rc.4
How can I specify style property values from the template so that I can re-use buttons? For example, if I wanted to specify a d
As of today you can achieve what you want!
You can use automatic property calculation!
In your css or template set background-color to the final color.
{{bgColor}}
In your animation definition :
animations: [
trigger('state', [
state('inactive', style({
'color': '#606060',
'background-color' : 'transparent'
})),
state('active', style({
'color': '#fff',
'background-color': '*' // <====
})),
transition('inactive <=> active', animate('100ms ease-out'))
])
]
something like this should work!