import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-progress-demo', templateUrl: './progress-demo.component.html', styleUrls: ['./progress-demo.component.scss'] }) export class ProgressDemoComponent implements OnInit { formatOne = (percent: number) => `${percent} Days`; formatTwo = () => `Done`; percent = 80; status="'normal"; constructor() { } ngOnInit() { } decline(){ this.percent = this.percent - 10; if (this.percent < 0) { this.percent = 0; } } increase(){ this.percent = this.percent + 10; if (this.percent > 100) { this.percent = 100; } } success() { this.status = 'success'; } error() { this.status = 'error'; } normal() { this.status = 'normal'; } }