Wondering what’s next for npm?Check out our public roadmap! »

angular-countdown-timer
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

angular-countdown-timer

Installation

To install this library, run:

$ npm install angular-countdown-timer --save

Consuming your library

$ npm install angular-countdown-timer

and then in your Angular Module:

import { NgModule } from '@angular/core';
 
// Import the Countdown Timer Module
import { CountdownTimerModule } from 'angular-countdown-timer';
 
@NgModule({
  imports: [
    CountdownTimerModule.forRoot()
  ]
})
export class YourModule { }
import { Component } from '@angular/core';
 
@Component({
  selector: 'app-your',
  templateUrl: './your.component.html',
  styleUrls: [ './your.component.css' ]
})
export class YourComponent  {
  date = new Date('2019-01-26T00:00:00');
  
  triggerFunction() {
    console.log('Timer Ended');
  }
  
}
 
<!-- You can now use Countdown Timer in any component of your module -->
<h1>
  {{title}}
</h1>
Timer mode:
<countdown-timer [start]="date"></countdown-timer>
 
Countdown:
<countdown-timer [end]="date"></countdown-timer>
 
Countdown with zero trigger:
<countdown-timer (zeroTrigger)="triggerFunction()" [end]="date"></countdown-timer>

Install

npm i angular-countdown-timer

DownloadsWeekly Downloads

109

Version

0.0.1

License

ISC

Unpacked Size

11.8 kB

Total Files

8

Last publish

Collaborators

  • avatar