import { ChangeDetectionStrategy, Component, Input, } from '@angular/core'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'progress-bar-component', styleUrls: [ './progress-bar.component.scss', ], templateUrl: './progress-bar.component.template.pug', }) export class ProgressBarComponent { @Input() public value: number; @Input() public max: number = 100; public getValueWidth() { return (this.value / this.max) * 100 + '%'; } }