ngx-countdown-2
v1.0.3
Published
Simple, easy and performance countdown for angular. Ticker event that emits every seconds
Downloads
54
Maintainers
Readme
ngx-countdown
Simple, easy and performance countdown for angular
Versions:
| Angular Version | ngx-countdown |
| --------------- | ------------- |
| Angular5 | |
| Angular4 | 1.0.6
|
Demo
Usage
1. Install
npm install ngx-countdown-2 --save
import CountdownModule
。
import { CountdownModule } from 'ngx-countdown';
@NgModule({
imports: [ BrowserModule, CountdownModule ],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
2、Template
<countdown [config]="config"
(start)="onStart()"
(finished)="onFinished()"
(notify)="onNotify($event)"></countdown>
| Name | Type | Default | Summary |
| ------- | ------------- | ----- | ----- |
| config
| Config | - | see Config |
| begin()
| - | - | Triggers when {demand: false}
|
| restart()
| - | - | - |
| stop()
| - | - | - |
| pause()
| - | - | - |
| resume()
| - | - | - |
| start
| EventEmitter
| - | Triggers when start |
| finished
| EventEmitter
| - | Triggers when finished |
| ticker
| EventEmitter
| - | Triggers every second |
| notify
| EventEmitter(time: number)
| - | Triggers when notify, need setting config.notify
values |
| event
| EventEmitter<{ action: string, left: number }>
| - | Catch all event |
How call component methods
@ViewChild(CountdownComponent) counter: CountdownComponent;
resetTimer(){
this.counter.restart();
this.counter.stop();
this.counter.pause();
this.counter.resume();
}
Troubleshooting
Please follow this guidelines when reporting bugs and feature requests:
- Use GitHub Issues board to report bugs and feature requests (not our email address)
- Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.
Thanks for understanding!
License
The MIT License (see the LICENSE file for the full text)