Toggle color doesnt change

how can i change the color when i pressed the toggle button, i have tried but it doesn’t work with any way…

<ion-icon name="ios-eye" item-start></ion-icon>
<ion-label> Estado del Equipo:</ion-label>
<ion-toggle [(ngModel)]="userPostData.estado" color="green" *ngIf="checked"></ion-toggle>
<ion-toggle [(ngModel)]="userPostData.estado" color="red" *ngIf="!checked" ></ion-toggle>

You can only change the color of checked toggles.

But as rapropos says this will only change the checked color, unless you overwrite the disabled styles or apply a conditional class.
Best regards,

Thanks, but how can i overwrite that disabled style?


i saw that tutorial, but it used radio-button, i need to use toggle :frowning:

Did you read my comment in that thread, or my earlier one in this thread?

ooh it is works, thanks (y)

how u did it?i want the toggle to change color when its checked and below code is not working

	    <ion-toggle color="green"></ion-toggle>

Can try this


<ion-item id="bg">
    <ion-label>TOGGLE COLOR</ion-label>
    <ion-toggle color="dark"></ion-toggle>


    background: rgb(54, 189, 194);