Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70442

Ionic 5: Ion-select-option Change Style using NgClass

$
0
0

Hello ,
I’m trying to change the color of text in Ion-select-option with ngClass (Ion-select : interface=“action-sheet”)
but without any success.

        <ion-item>
          <ion-label>{{'TIME'| translate}}</ion-label>
          <ion-select color="green" formControlName="canteen" (ionChange)="changeTime()" interface="action-sheet" style="max-width: 100%" [cancelText]="cancel">
            <ion-select-option *ngFor="let time of crns" value="{{time.idct}}" [ngClass]="{
              'ion-select-red': time.subs<=0 ,
              'ion-select-green': time.subs>0
            }" [disabled]="time.subs<=0">
              {{time.creneau}} </ion-select-option>
          </ion-select>
        </ion-item>
.ion-select-red {
    --color: var(--ion-color-danger);
}

.ion-select-green {
    --color: var(--ion-color-green);
}

Any help please.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70442

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>