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

Issue with ticks on using decimal ranges #82

Open palanii opened 9 years ago

palanii commented 9 years ago

We are using angular slider with some decimal steps. This is the code we are using:

$scope.slider = { value: 1, options: { useDecimal: true, orientation: 'horizontal', min: 0.5, max: 3, range: 'min', step: 0.5, tick: true, change: refreshSwatch } };

While implementing the ticks, we are not getting any ticks. In postLink method we are calculating the total ticks by. var total = parseInt(parseInt(options['max'])/parseInt(options['step'])); Its returning NaN in our case. Here we'll have to check useDecimal flag before calculating the total. I've replaced this by below and i can able to see ticks on the screen. var total = parseInt(options['max']/options['step']);

Is this something needs to be fixed in the library..?

Thanks, Palanisamy