I'm trying to make a if
in typescript but it's simply ignored and never goes into 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?