1
I’m trying to make a if
in typescript but it simply gets ignored and never enters the condition.
My typescript code:
import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
@Component({
selector: 'page-jogomemoria',
templateUrl: 'jogomemoria.html',
})
export class JogomemoriaPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {}
vira1() {
document.getElementById("virada0").style.zIndex = "999";
verificaViradasCima++;
}
if (verificaViradasCima = 2) {
alert("Voce clicou duas vezes");
}
}
var verificaViradasCima = 0;
Why does this happen ?
Whenever you use the code here on live snippet format it by clicking on the "Organize" button that appears in the left bar. This makes it much easier to read for anyone who wants to reply.
– Isac