Hello,
I made a simple timer for my app.
The problem is that its not working on every device.
import { Observable } from 'rxjs/Rx';
i: number = 0;
m: number = 0;
s: number = 0;
wykonaj(){
if(this.seria < 4){
this.seria++;
this.subscription = Observable.interval(1000).subscribe(x => {
this.i++;
});
}
}
showTimer(){
this.m = Math.floor(this.i/60);
this.s = this.i - this.m*60;
if(this.m < 10 && this.s < 10)
return "0"+this.m+":0"+this.s;
else if(this.m < 10 && this.s > 9)
return "0"+this.m+":"+this.s;
else if(this.m > 9 && this.s < 10)
return this.m+":0"+this.s;
}
On half devices it just refresh to main page istead of well counting.
There is a short film ilustrating my problem:
Film