intervalID: number;
value: number=0;
startGame(){
console.log("gameStarted");
this.intervalID=window.setInterval(this.currentNumber,2000);
}
currentNumber(){
console.log("in current number");
console.log(this.value);//**Here i am getting undefined**
this.value++;
console.log(this.value);// **here i am getting NaN**
this.numberGenerated.emit({currentValue:this.value});
}
When using value in currentNumber, i am getting undefined. As a result any operations done on value leads to NaN