crisbeto / angular-svg-round-progressbar

Angular module that uses SVG to create a circular progressbar
https://crisbeto.github.io/angular-svg-round-progressbar/
MIT License
741 stars 174 forks source link

Binding #69

Closed digirew closed 8 years ago

digirew commented 8 years ago

I want to be able to change the values of the progress bar from within the controller, but the values aren't updated or even parsed - I don't know if this is some binding issue or what...

<div round-progress
                        max="{{project.timer.max}}"
                        current="{{project.timer.current}}"
                        bgcolor="{{project.timer.transparent}}"
                        radius="{{ project.timer.radius*1.5 }}"
                        stroke="{{ project.timer.stroke }}"
                        offset="inherit"></div>

I'm using vm instead of $scope - is this a possible source of issue?

crisbeto commented 8 years ago

This isn't a whole lot to go on. Are you sure you're triggering a digest when the values change? Try wrapping your code in a $scope.$apply.

digirew commented 8 years ago

Sorry - I have a model defined as something like this (all the values are there)

            vm.projects[index].name="project a";
            vm.projects[index].timer.current =        27;
            vm.projects[index].timer.max =            50;
            vm.projects[index].timer.offset =         0;
            vm.projects[index].timer.timerCurrent =   0;
            vm.projects[index].timer.uploadCurrent =  0;
            ...

then i have a ng-repeat ="project in projects"

all the other values in the ng-repeat are filled and used (like name), but not for this directive...

crisbeto commented 8 years ago

Sorry, but this still isn't enough to go on. The demo uses the same types of bindings and I just tried it with a ngRepeat and it worked fine. Can you try to isolate it into a fiddle/codepen?