1.0.3 • Published 5 years ago

ngx-countdown-2 v1.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

ngx-countdown

Simple, easy and performance countdown for angular

NPM version Build Status

Versions:

Angular Versionngx-countdown
Angular5NPM version
Angular41.0.6

Demo

Live 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>
NameTypeDefaultSummary
configConfig-see Config
begin()--Triggers when {demand: false}
restart()---
stop()---
pause()---
resume()---
startEventEmitter-Triggers when start
finishedEventEmitter-Triggers when finished
tickerEventEmitter-Triggers every second
notifyEventEmitter(time: number)-Triggers when notify, need setting config.notify values
eventEventEmitter<{ 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:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. 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)