We are making an Angular2 application and we want to be able to somehow create a global CSS variable (and update the properties\' values whenever changed wh
You don't have any example code but I assume you want to do something like this?
@View({
directives: [NgClass],
styles: [`
.${TodoModel.COMPLETED} {
text-decoration: line-through;
}
.${TodoModel.STARTED} {
color: green;
}
`],
template: `
{{todo.title}}
`
})
You assign ng-class to a variable which is dynamic (a property of a model called TodoModel as you can guess).
todo.toggle() is changing the value of todo.status and there for the class of the input is changing.
This is an example for class name but actually you could do the same think for css properties.
I hope this is what you meant.
This example is taken for the great egghead tutorial here.