# ngx-countdown-2

> Simple, easy and performance countdown for angular. Ticker event that emits every seconds

Latest version **1.0.3** (published 2019-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-countdown-2
pnpm add ngx-countdown-2
yarn add ngx-countdown-2
bun add ngx-countdown-2
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-05-05 |
| First published | 2019-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 218.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | cipchk |
| Maintainers | lexwizzy |
| Keywords | ngx-countdown, ng2-countdown, angular-countdown, angular2-countdown, countdown, count down |

## Links

- npm: https://www.npmjs.com/package/ngx-countdown-2
- Repository: https://github.com/code-wizard/ngx-countdown
- Homepage: https://github.com/code-wizard/ngx-countdown#readme
- Issues: https://github.com/code-wizard/ngx-countdown/issues
- npm.io page: https://npm.io/package/ngx-countdown-2

## Recent versions

- 1.0.3 (latest) — 2019-05-05
- 1.0.2 — 2019-05-05
- 1.0.1 — 2019-05-05
- 1.0.0 — 2019-05-05

## README

# ngx-countdown
Simple, easy and performance countdown for angular

[![NPM version](https://img.shields.io/npm/v/ngx-countdown.svg)](https://www.npmjs.com/package/ngx-countdown)
[![Build Status](https://travis-ci.org/cipchk/ngx-countdown.svg?branch=master)](https://travis-ci.org/cipchk/ngx-countdown)

Versions:

| Angular Version | ngx-countdown |
| --------------- | ------------- |
| Angular5 | [![NPM version](https://img.shields.io/npm/v/ngx-countdown.svg)](https://www.npmjs.com/package/ngx-countdown) |
| Angular4 | `1.0.6` |

## Demo

[Live Demo](https://github.com/code-wizard/ngx-countdown)

## Usage

### 1. Install

```
npm install ngx-countdown-2 --save
```

import `CountdownModule`。

```typescript
import { CountdownModule } from 'ngx-countdown';

@NgModule({
    imports: [ BrowserModule, CountdownModule ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }
```

### 2、Template

```html
<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**

```typescript
@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](https://github.com/code-wizard/ngx-countdown/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](https://github.com/code-wizard/ngx-countdown/blob/master/LICENSE) file for the full text)

---
_Source: https://npm.io/package/ngx-countdown-2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
