app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
isDisable:boolean = false;
progress:number = 0;
maxValue:number = 250;
timer: any;
onClick(){
this.progress = 0;
this.isDisable = true;
this.timer = setInterval(() => this.updateProgress(), 100)
}
updateProgress(){
this.progress++
if(this.progress>=this.maxValue)
{
clearInterval(this.timer);
this.isDisable = false;
}
}
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - Progressbar maximum value
</h4>
<button (click)="onClick()" [disabled]="isDisable">Run Task</button>
<br/><br/>
<h5>{{'Done '+ progress + ' of '+ maxValue}}</h5>
<br/>
<ngb-progressbar
type="success"
[value]="progress"
[showValue]="true"
[max]="maxValue">
</ngb-progressbar>
- angular bootstrap - How to use Progressbar
- angular bootstrap - Show text inside Progressbar
- angular bootstrap - How to show striped Progressbar
- angular bootstrap - Light & dark Progressbar
- angular bootstrap - How to use Popover
- angular bootstrap - Open Popover on mouse hover
- angular bootstrap - Open close Popover on button click
- angular bootstrap - Popover manual triggers
- angular bootstrap - Popover custom CSS class
- angular bootstrap - Popover shown & hidden event
- angular bootstrap - Timepicker with meridian
- angular bootstrap - Timepicker without spinner
- angular bootstrap - Timepicker custom steps
- angular bootstrap - Datepicker navigate to specific year month
- angular bootstrap - Datepicker navigate select specific date