【发布时间】:2018-11-21 15:06:06
【问题描述】:
假设我有一个组件 html,其中有我的 html 我的progress bar
<round-progress #progress
[current]="current"
</round-progress>
Current 是百分比值。在我的 ts 组件中,我这样做:
this.percentageSubscription=this.percentageService.percentage$.subscribe((percentage)=>{
this.current=this.current+percentage;
console.log(this.current);
});
我打印的值是正确的。它是按照另一种算法增加的。 console.log 显示正确的增量,但我的百分比值在进度条中没有增加。谁能帮帮我?
【问题讨论】:
-
round-progress组件如何使用当前值?它有什么用?尝试将
{{current}}添加到您的模板中,看看该值是否更新。如果是这样,那么循环进度组件很可能只读取当前值一次。 -
@Arne 我放了 {{current}} 并且每次百分比增加时该值都不会更新,但它显示为 0 值和 100 值,但不显示 20% 或 35% .我不知道我需要做什么才能更新这一轮进度
标签: javascript angular typescript progress-bar angular6