0

I am currently working on an Ionic2 project. It a question/answer page.

I have to create a simple countdown timer with pause/resume functionality.

Scenario is, on page load, countdown timer will start with 40 minutes. On every passing minutes(60 seconds) timer will reduce 1 minute. But if user press the pause button the timer will pause, and whenever the user press resume button the timer will start from previous paused value.

Please help as I cant figure out how to achieve this.

raju
  • 6,448
  • 24
  • 80
  • 163
  • Can you post of the code you have tried either in plunkr or any online editor? so that we can look into. – Smit Mar 07 '17 at 00:56

1 Answers1

1

Yes, this is very much possible. Please check these AngularJS timer examples:

https://siddii.github.io/angular-timer/examples.html#/angularjs-single-timer-demo

I would recommend some api where you can create your own "Timer" object like the Jquery timer or Angular Timer.

In Angular 2 you could use Observable.timer and described in this SO answer.

You could also check out ng2-simple-timer or ng2-timer.

Good luck!

Community
  • 1
  • 1
Jim
  • 3,821
  • 1
  • 28
  • 60