Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

Exception with the latest version #66

Open
mastermind1981 opened this issue Jun 6, 2015 · 5 comments
Open

Exception with the latest version #66

mastermind1981 opened this issue Jun 6, 2015 · 5 comments

Comments

@mastermind1981
Copy link

Hi,

I updated for the last version to have the correction of the 2 way data binding, but i got an exception:


RangeError: toFixed() digits argument must be between 0 and 20
    at Number.toFixed (native)
    at Slider._applyToFixedAndParseFloat (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:1305:28)
    at Slider._applyPrecision (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:1297:17)
    at Slider.setValue (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:732:30)
    at createNewSlider (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:614:9)
    at new Slider (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:301:20)
    at HTMLInputElement.<anonymous> (http://localhost:3000/bower_components/seiyria-bootstrap-slider/js/bootstrap-slider.js:152:25)
    at http://localhost:3000/bower_components/jquery/dist/jquery.js:144:20
    at Function.jQuery.extend.map (http://localhost:3000/bower_components/jquery/dist/jquery.js:467:13)
    at jQuery.fn.jQuery.map (http://localhost:3000/bower_components/jquery/dist/jquery.js:143:33)

Here is the markup:

 <slider ng-model="range.value" range="true" step="range.step" min="range.min" max="range.max" tooltip_split="true"></slider>

And here is the controller:

 $scope.range = {
        min: 10000,
        max: 1000000,
        step: 10000,
        value: []
      };
      $scope.delayedMin = parseInt($scope.allFilters.priceMin, 10);
      $scope.delayedMax = parseInt($scope.allFilters.priceMax, 10);
      $scope.range.value = [$scope.delayedMin,$scope.delayedMax] ;
@seiyria
Copy link
Owner

seiyria commented Jun 6, 2015

Have you tried passing in the precision argument? Even if setting it to 0.

@mastermind1981
Copy link
Author

it works but the 2 way databinding does not work

@seiyria
Copy link
Owner

seiyria commented Jun 6, 2015

Ok, that's kinda strange. Would you mind investigating and making a small demo?

@mastermind1981
Copy link
Author

Here is a plunker. I setted the model inside the controller but the slider doesn't seem to like it.

@bernardmoes
Copy link

@mastermind1981 Here's a quickfix for you:

    $timeout(function() {
      $scope.exampleModel = [ 5 , 9];
    });

Make sure to inject $timeout.

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

No branches or pull requests

3 participants