有条件地更改垫子半径外圆的颜色

时间:2020-02-18 15:18:44

标签: css angular-material angular8

我正在尝试在角度8应用程序中更改mat-radio-outer-circle的颜色。

在我的CSS中,我有一堂课,

.mat-radio-outer-circle{
  border-color: rgb(255, 153, 0) !important;
}

这很好用,但是我想有条件地应用这种颜色。

同样,我的CSS中有2个类,

    .mat-radio-outer-circle-mandatory{
  border-color: rgb(255, 153, 0) !important;
}

.mat-radio-outer-circle-non-mandatory {
  border-color: rgba(26, 17, 5, 0) !important;
}

我不确定要在哪里应用它们?它应该在或

我正在寻找这样的东西,

<mat-radio-button *ngFor="let codeValue of auditItem.surveyQuestion.code.values;let idx = index"
                          [value]="codeValue.value" 
                          [ngClass]="{'mat-radio-outer-circle-mandatory': 'auditItem.required  && !IsDeferValidations()',
                                      'mat-radio-outer-circle-non-mandatory':'!auditItem.required  || !IsDeferValidations()'}">
                              {{ codeValue.description }}
                          </mat-radio-button>

0 个答案:

没有答案
相关问题