Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newTimer() {
- this.countDown = this.timerProvider.newTimer(this.endTimer); //pass function below
- }
- endTimer() {
- const indexModal = this.viewCtrl.index;
- // then we remove it from the navigation stack
- //this.navCtrl.remove(2);
- if(this.answerModal) {
- this.answerModal.dismiss();
- }
- if(this.hintModal) {
- this.hintModal.dismiss();
- }
- this.navCtrl.push(WinnersPage, {
- gameId: this.gameId
- }).then(() => {
- });
- this.storage.set('firstAnswerCreated', '');
- this.playaudio.pause();
- console.log('timer ENDED');
- }
- countDown: any;
- counter = 1*100;
- tick = 1000;
- constructor(public http: HttpClient) {
- //console.log('Hello TimerProvider Provider');
- }
- newTimer(endTimer) {
- return Observable.timer(0, this.tick).take(this.counter).map(() => --this.counter).finally(() => endTimer());
- }
Add Comment
Please, Sign In to add comment