Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress doesnt update when percent changes #212

Open
toalmoal opened this issue May 13, 2024 · 1 comment
Open

Progress doesnt update when percent changes #212

toalmoal opened this issue May 13, 2024 · 1 comment

Comments

@toalmoal
Copy link

toalmoal commented May 13, 2024

Hi,

First of all, thanks for creating and sharing this beautiful component.

I am trying to use this in an angular 17 project, however when the percentage changes, the component doesnt reflect the change and stays at 0. renderOnClick would force a render, but that defeats the purpose.

The relavent sections of the code are as follows:

<circle-progress [percent]="uploadProgressPercent()" [renderOnClick]="false"></circle-progress>

and in .ts file (i'm using a form to pass on the upload progress atm)

uploadProgressPercent() { const value = _.get(this.formGroup, 'controls.uploadProgressPercent.value'); console.log(value); return value; }

@nishk02
Copy link

nishk02 commented Aug 4, 2024

@toalmoal

I believe passing a method directly as the value for a property in Angular, like [percent]="uploadProgressPercent()", does not create a two-way data binding.

use property instead,
<circle-progress [percent]="uploadProgress" [renderOnClick]="false"></circle-progress>

uploadProgres!: any;
constructor() {
  this.uploadProgressPercent();
}
uploadProgressPercent() {
  this.uploadProgress = _.get(this.formGroup, 'controls.uploadProgressPercent.value');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants