2

I want to change the css class property value dynamically. On below code 'color' is the variable that I want to pass to the styles.

    @Component({
    selector: 'app-gridmaker-component',
    templateUrl: './gridmaker-component.component.html',
    styles: [`
    ::ng-deep .dx-datagrid .dx-row-alt > td {
        background-color: color!important;  /* color is the variable */
    }
    `]

})

Thanks is advance.

Arpan Das
  • 162
  • 1
  • 2
  • 9
  • Wht not bind directly in HTML(template) using `ngStyle`? – Pardeep Jain Nov 16 '18 at 07:51
  • 2
    Possible duplicate of [Angular2 dynamic change CSS property](https://stackoverflow.com/questions/33328347/angular2-dynamic-change-css-property) – SiddAjmera Nov 16 '18 at 07:58
  • I was looking something like this, https://medium.com/creative-technology-concepts-code/css-in-javascript-with-angular-61da79111804 – Arpan Das Mar 26 '19 at 13:54

0 Answers0