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

If you have multiple ui-slider's with different min/max values, but the same option object, the mix/max become the same for all the sliders. #92

Closed jjbskir closed 8 years ago

jjbskir commented 8 years ago

I have a situation where I want multiple sliders that have different min/max values defined in the directive. But I want to pass in the same option object to all of the directives to handle a callback when the user stops dragging the slider. The issue with doing this is that the option object is shared between all three of the directives and only the last slider's min/max values are used for all the sliders.

Here is a jsfiddle example - http://jsfiddle.net/s8kska2m/

Is this meant to be? I know some simple solutions to get around this, but it seemed kind of odd.

PowerKiKi commented 8 years ago

That seems like a bug to me. If you are able to create a PR for that, I'll merge it.

jjbskir commented 8 years ago

Hey I just created a pull request for this. The update I made was to clone the directive option object. Is it ok that I used jQuery to handle the cloning?