My problem is that I do not know how to do a setInterval on Ionic3. I put the following in the .ts of my page:
export class ClickerPage {
public dinero=0;
public produccion=1;
constructor(public navCtrl: NavController) {
setInterval(function(){
this.dinero+=this.produccion;
}, 1000);
}
...
And in the view I used:
<ion-item>
<ion-icon name="cash" item-start></ion-icon>
Dinero:
<ion-badge item-end>{{dinero}}</ion-badge>
</ion-item>
But it does not work, it just does not update, I do not know if it goes in the constructor like I did, or it goes somewhere else in the setInterval. Can you help me? Thanks!