cotag / orbicular

A CSS based circular progress bar for AngularJS
MIT License
47 stars 15 forks source link

If both $scope.current and $scope.total are 0, the result of the watch function 'update' is NaN #15

Closed bropp closed 10 years ago

bropp commented 10 years ago

If a non-zero value has already been set on $scope.current and $scope.total, and then the values are set to zero, the circle will not update correctly because updateProgress is given a NaN as the pos parameter.

As a quick fix, I added this conditional at the beginning of updateProgress:

if (isNaN(pos)) {
  pos = 0;
}

There is probably a better way to fix this, but this is working for now.

stakach commented 10 years ago

Thanks! Bumped version to v3.1.1