I have implemented a progress bar, but I am encountering some issues with it.
The progress bar is supposed to complete in 5 seconds. However, the value updates every second rather than continuously, causing it to pause intermittently.
HTML
<dx-progress-bar
#progressBar
[showStatus]="false"
id="progress-bar-status"
[rtlEnabled]="true"
[class.complete]="progressBar.value == maxValue"
[min]="0"
[max]="maxValue"
[value]="maxValue - seconds"
>
</dx-progress-bar>
.Ts
seconds = 5;
maxValue = 5;
intervalId: number;
onButtonClick() {
this.seconds = 5;
this.intervalId = window.setInterval(() => this.timer(), 1000);
}
timer() {
this.seconds--;
if (this.seconds == 0) {
clearInterval(this.intervalId);
}
}
intended result