Skip to main content
Reversão para edição 2
Fonte Link
Sam
  • 80,8mil
  • 22
  • 73
  • 128

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
}
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
}
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Ajuste no código
Fonte Link
Sam
  • 80,8mil
  • 22
  • 73
  • 128

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
}
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
}
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

removeu 28 caracteres do conteúdo
Fonte Link

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">Lavagem simplescheck]="checked">item moto01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">Lavagem completocheck]="checked">item carro02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">Lavagem simples moto <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">Lavagem completo carro <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Como faço para mudar apenas o checkbox que estou clicando?

checked:boolean=false;
ck() {
    if(this.checked === false){
      this.checked=true;
    }else{
      this.checked=false;
    }
<ion-item>
  <ion-label  class="title" [class.title-service-check]="checked">item 01 <span class="box-service-price">R$ 80,00</span></ion-label>
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>      
</ion-item>
<ion-item>
  <ion-label class="title" [class.title-service-check]="checked">item 02 <span>R$ 80,00</span></ion-label>        
  <ion-checkbox color="green" (click)="ck()"></ion-checkbox>
</ion-item>

Fonte Link
Carregando