Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 231266

A question about conditionals

$
0
0
export class HomePage {
  variable1 = 0;
  variable2 = 0;
}
 <ion-list>
    <ion-item>
      <ion-label>variable 1</ion-label>
      <ion-input [ngModel]="variable1" (ngModelChange)="variable1 = +$event"></ion-input>
    </ion-item>
    <ion-item>
      <ion-label>variable 2</ion-label>
      <ion-input [ngModel]="variable2" (ngModelChange)="variable2 = +$event"></ion-input>
    </ion-item>
    <ion-item *ngIf="variable1 === 1 && variable2 === 2">
      <ion-label>achievement unlocked</ion-label>
    </ion-item>
  </ion-list>

If I type “1” into the variable 1 input, and “2” into the variable 2 input, I see “achievement unlocked”. Do you?


Viewing all articles
Browse latest Browse all 231266

Trending Articles



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