ui-slider icon indicating copy to clipboard operation
ui-slider copied to clipboard

Changing min/max values after slider creation?

Open akashihi opened this issue 9 years ago • 1 comments

Is it possible to change max value when slider is already created and used?

I tried that approach:

$scope.slider = {
    options: {
        range: false,
        min: 1,
        max: $scope.selectedQuant.maxValue,
        step: 1
    }
};

[....skip...] $scope.slider.options.max = $scope.selectedQuant.maxValue

but it doesn't works.

akashihi avatar Jan 11 '16 15:01 akashihi

Works for me, although it doesn't generate new "ticks" if you have that option enabled. <div ui-slider data-min="0" data-max="{{attributeCount - 1}}" data-step="1" data-tick ng-model="sliderValue"></div>

When I add new objects to my collection I update the count the data-max attribute uses. It didn't work when I set it to attributes.length so I added the watchCollection. $scope.$watchCollection("attributes", function () { $scope.attributeCount = $scope.attributes.length; });

Alexabix avatar Jul 01 '16 11:07 Alexabix