Reputation: 375
Updated only after page reload. Is it possible to update the progress bar in real time?
<mat-progress-bar
*ngIf="row.stage === 'importing_in_progress'"
class="exchange-files__progress-bar"
mode="determinate"
[value]="row.progress"
></mat-progress-bar>
Upvotes: 0
Views: 921
Reputation: 360
Make sure the value you pass to the [value]
attribute is updated in a way so angular change detection will pick it up. One way is to use an observable
const progress = of([1,3,4]).pipe(delay(1000));
and pass it to mat-progress-bar
with the async
pipe.
<mat-progress-bar
...
[value]="progress | async"
></mat-progress-bar>
This should make the progress bar update in real-time.
Upvotes: 1