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.

1
  • Can you post of the code you have tried either in plunkr or any online editor? so that we can look into. Commented Mar 7, 2017 at 0:56

1 Answer 1

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!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.