Welcome folks today in this blog post we will be building a digital countdown timer
clock in browser using typescript
and we will be using the ngx-countdown
library. All the full source code of the application is shown below.
Get Started
In order to get started you need to install the below libraries using the npm
command as shown below
npm i ngx-countdown
And after that you need to copy paste the below code inside the app.component.ts
file as shown below
app.component.ts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import { bootstrapApplication } from '@angular/platform-browser'; import { Component } from '@angular/core'; import { CountdownComponent } from 'ngx-countdown'; @Component({ selector: 'my-app', template: ` <countdown [config]="{leftTime: 30}"></countdown> `, standalone: true, imports: [CountdownComponent], }) export class AppComponent {} bootstrapApplication(AppComponent).catch((err) => console.error(err)); |