I am wondering if it is possible to pass a variable to a css class to an external css file in angular 2, for example:
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app works!'; bgc: string = 'orange' }
then on "app.component.css" I would like to go through as
.mydiv{ background: {{bgc}}; }
Is it possible?
jcdsr source share