NgxTimer
Count up timer for angular 5+
Installation
npm i ngx-timer --save
Usage
;
1.Count Up Timer
In html
You can import CountupTimerService from ngx-timer to do the following functionalities.
- To start the timer
this.countupTimerService.startTimer;
By passing a start time to above function timer will start from that. eg :-
;cdate.setHourscdate.getHours-2;this.countupTimerService.startTimercdate;
- To pause the timer
this.countupTimerService.pauseTimer;
- To stop the timer
this.countupTimerService.stopTimer;
Configurations
Import countUpTimerConfigModel model from ngx-timer you will be able use following configurations.
; ngOnInit: void
2.Count Down Timer
In html
You can import CountdownTimerService from ngx-timer to do the following functionalities.
1.To start the timer
;cdate.setHourscdate.getHours + 2;this.CountdownTimerService.startTimercdate;
2.To pause the timer
this.CountdownTimerService.pauseTimer;
3.To stop the timer
this.CountdownTimerService.stopTimer;
3.To resume the timer
this.CountdownTimerService.resumeTimer;
4.To get Current Status
this.CountdownTimerService.onTimerStatusChange.subscribe;
Configurations
Import countUpTimerConfigModel model from ngx-timer you will be able use following configurations.
; ngOnInit: void
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. 😊
Impending
- Day,Month and Year Configuration for both timers.
- Stopwatch implementation.