Countdown Timer for Angular 7+
npm install angular-countdown-timerTo install this library, run:
``bash`
$ npm install angular-countdown-timer --save
`bash`
$ npm install angular-countdown-timer
and then in your Angular Module:
`typescript
import { NgModule } from '@angular/core';
// Import the Countdown Timer Module
import { CountdownTimerModule } from 'angular-countdown-timer';
@NgModule({
imports: [
CountdownTimerModule.forRoot()
]
})
export class YourModule { }
`
`typescript
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');
}
}
`
`xml
{{title}}
Timer mode:
Countdown:
Countdown with zero trigger:
``