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

Changing min/max values after slider creation? #97

Open
akashihi opened this issue Jan 11, 2016 · 1 comment
Open

Changing min/max values after slider creation? #97

akashihi opened this issue Jan 11, 2016 · 1 comment

Comments

@akashihi
Copy link

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.

@Alexabix
Copy link

Alexabix commented Jul 1, 2016

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; });

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

2 participants