Angular 7 - Change color of Mat-select-value based on condition

Viewed 1040

I have a mat select and I would like to change the color of the selected value based on a condition. basically to show the user that a change was made. I know that I can access the mat-select-value from the styles but not sure how to implement a condition to it using ng-class:

<mat-form-field>
      <mat-select name="list"  
      [style.color]="myCondtition ? 'none': 'green'"
      (selectionChange)="change()">
        <mat-option *ngFor="let option of options" [value]="currentOption">
          {{option.viewvalue}}
         </mat-option>
      </mat-select>

I was able to get things like [style.font-weight], [style.background-color] and [style.font-size] to work but there is no font-color and just [style.color]only seems to work with inputs.

1 Answers
Related