angular-ui / ui-slider

jQuery UI Slider for AngularJS
https://htmlpreview.github.io/?https://github.com/angular-ui/ui-slider/master/demo/index.html
MIT License
265 stars 176 forks source link

Setting min and max values dynamically. #89

Closed staklau closed 8 years ago

staklau commented 9 years ago

I need to load the min- and max values from an external source so that I can set the min and max values of a slider like this.

$scope.minMaxValues = {
      slider1: {
        min: 0,
        max: 200
      },
      slider2: {
        min: 0,
        max: 200
      },
      slider3: {
        min: 0,
        max: 200
      },
      slider4: {
        min: 0,
        max: 200
      },
      slider5: {
        min: 0,
        max: 200
      }
    };
<div class = "ui-slider-range ui-slider-handle" ui-slider="{range: true}" min="minMaxValues.slider1.min" max="minMaxValues.slider1.max" step="0.01" use-decimals ng-model="sliderValues[0]"></div>

How can this be done?

ghost commented 9 years ago

Have you changed the value of ng-model which is named sliderValues[0] ?