darul75 / angular-awesome-slider

:arrows_clockwise: Angular slider control directive
http://darul75.github.io/angular-awesome-slider/
MIT License
143 stars 63 forks source link

I can't set decimal range in from and to options #143

Open rbonillaAlivebox opened 8 years ago

rbonillaAlivebox commented 8 years ago

I need to manage a decimal range in the slider.

In example:

from: 0.005, to: 0.08, step: 0.005, round: 3, scale: [0.005, 0.04, 0.08]

darul75 commented 8 years ago

Hi, I will give a solution soon. I need to give a try first

darul75 commented 8 years ago

Could you try something like the following instead:

    var calculate = function( value ) {        
        return value/100;
    };

    $scope.options = {              
        from: 0,
        to: 8,
        step: 0.5,
        round: 1,
        scale: [0.005, 0.04, 0.08],
        smooth: false,
        calculate: calculate,
        callback: function(value, elt) {            
            console.log('new value is ' + value);
        }               
    };

http://jsfiddle.net/darul75/2m3u0qvh/4/