Angular 通过单击按钮更改进度值

Angular 通过单击按钮更改进度值,angular,typescript,Angular,Typescript,我使用的是NgCircleProgressModule库,它允许我在中心获得一个圆和一个百分比值 我知道进度值是静态的,只有在单击按钮时才会更改 如果单击圆中心的25%按钮,则会出现25%和相同的按钮 当我单击按钮时,我只需更改以下内容:[percent]=“25”,但我不知道如何创建函数,以便[percent]获得与按钮关联的值 有人知道我怎么做吗 HTML <circle-progress [percent]="progress" [radius]="100" [outer

我使用的是
NgCircleProgressModule
库,它允许我在中心获得一个圆和一个百分比值

我知道进度值是静态的,只有在单击按钮时才会更改

如果单击圆中心的25%按钮,则会出现25%和相同的按钮

当我单击按钮时,我只需更改以下内容:
[percent]=“25”
,但我不知道如何创建函数,以便[percent]获得与按钮关联的值

有人知道我怎么做吗

HTML

<circle-progress
  [percent]="progress"
  [radius]="100"
  [outerStrokeWidth]="10"
  [innerStrokeWidth]="10"
  [space] = "-10"
  [outerStrokeColor]="'#4882c2'"
  [innerStrokeColor]="'#e7e8ea'"
  [titleFontSize]= "24"
  [unitsFontSize]= "24"
  [showSubtitle] = "false"
  [animation]="true"
  [animationDuration]="300"
  [startFromZero]="false"
  [responsive]="true"
></circle-progress>

<button>25%</button>

25%
使用
(单击)
事件尝试如下操作:

<button (click)="progress = 25">25%</button>

谢谢!!这真是一团糟,就这么简单。谢谢我建议您将进度变量的设置值移动到组件中的方法。@MikeLanders欢迎您。如果这有帮助,请接受答案。第二种解决方案是更好的解决方案,即使您以后想保存这些值。我已经接受了答案,我只是在等待超时是的,在第二种方式中,您可以根据不同函数的某个事件动态设置值
<button (click)="changeProgress(25)">25%</button>
changeProgress(value) {
  this.progress = value
}