Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

Change color seat

$
0
0

Can someone help me how to change the color and maintain it, my problem is when it goes to the next page, what was enabled is lost and it is not maintained

html
<ion-icon

              *ngFor="let seats of ReservasData;  let i = index;"

              class="cls-icon"

              [ngClass]="{'cls-icon1':seats.estado=='False','active':seats.estado=='True'}"

              src="../../../assets/img/icons/{{seats.img}}"

              (click)="openUpdate(seats,seats.estado,seats.id,seats.price)"

            ></ion-icon>

>
ts.
openUpdate(item, state, id, precio) {

    if (state == "ocupado") {

      console.log("Lo sentimos está ocupado");

    } else if (state == "space") {

      console.log("no hay nada");

    } else if (state == "chofer") {

      console.log("chofer");

    } else {

      item.estado = !item.estado;

}
.scss
.cls-icon {

              color: black;

              &.active {

                color: green;

              }

              &.inactive {

                color: black;

              }

            }

djiasjdas

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



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