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;
timer: any;
onClick(){
this.progress = 0;
this.isDisable = true;
this.timer = setInterval(() => this.updateProgress(), 300)
}
updateProgress(){
this.progress++
if(this.progress>=100)
{
clearInterval(this.timer);
this.isDisable = false;
}
}
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - Show text inside Progressbar
</h4>
<button (click)="onClick()" [disabled]="isDisable">Run Task</button>
<br/><br/>
<ngb-progressbar
type="success"
[value]="progress"
[showValue]="true">
</ngb-progressbar>
- angular - Loop through an array of objects
- angular - How to use Button click event
- angular - How to call function on Button click
- angular - How to use ternary operator
- angular - How to generate random number
- angular - How to toggle element visibility
- angular bootstrap - How to show an alert
- angular bootstrap - How to use Collapse
- angular bootstrap - How to use Rating
- angular bootstrap - How to use Progressbar
- angular bootstrap - Progressbar maximum value
- angular bootstrap - How to show striped Progressbar
- angular bootstrap - Light & dark Progressbar
- angular material - How to use Button toggle group
- angular material - Button toggle group multiple selection