ngx-countdown-2
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

ngx-countdown

Simple, easy and performance countdown for angular

NPM version Build Status

Versions:

Angular Version ngx-countdown
Angular5 NPM version
Angular4 1.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>
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) counterCountdownComponent;
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)

Package Sidebar

Install

npm i ngx-countdown-2

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

224 kB

Total Files

27

Last publish

Collaborators

  • lexwizzy