darul75 / angular-awesome-slider

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

Attaching on click callback #43

Closed primez closed 9 years ago

primez commented 9 years ago

Hi, Julien! Sorry if my question is silly. How can I attach on click callback or prohibit a click on a slider, because click on a slider change it, but model does not seem to change at all.

darul75 commented 9 years ago

hi,

no matter at all, all questions are welcome ;)

by default, input 'ng-model' attribute scope model is propagated, if not => bug

<input ng-model="myvalue"  type="text" id="myslider" slider options="options" />

and into your js angular code:

$scope.myvalue = "10;15";

$scope.options = {              
                from: 0,
                to: 40,
                step: 0.5,
                dimension: " $",
                round: 1,
                scale: [0, '|', 10, '|', 20, '|' , 30, '|', 40],
                heterogeneity: ['50/100', '75/250']
}

complete examples here

https://github.com/darul75/ng-slider/blob/master/src/ng-slider.html

keep me up to date

primez commented 9 years ago

Thank you for your answer. I've checked ng-slider.html code example and made a few screenshots to show you. I think there is a bug, because on this screenshot model and slider are in sync: http://take.ms/XNetB, but then after clicking on a slider -> http://take.ms/XKSmt - model remains the same, but slider value has changed.

darul75 commented 9 years ago

can you send me you console output, maybe js error somewhere ? or your html and js code, thx for screenshot, I will help you

primez commented 9 years ago

This is from an example: http://take.ms/esasm. My code looks the same, I've just copied everything from an example, but without angular-mocks and it works the same.

primez commented 9 years ago

And one more thing I can't understand -> one your demo page: http://darul75.github.io/ng-slider/ sliders are without click at all.

darul75 commented 9 years ago

maybe check several angular versions included, it looks weird, you can remove angular-mock dependency from src html file example, not needed at all

primez commented 9 years ago

Yes, I've removed mocks. That error has gone, but click still works the same. Ok, I will try previous angular versions

darul75 commented 9 years ago

sorry bug :) I was not clicking, just moving...

darul75 commented 9 years ago

resolved asap, regression...

primez commented 9 years ago

Ok. Thank you very much.

darul75 commented 9 years ago

resolved in 2.0.8, thanks

primez commented 9 years ago

Works great, Thank you.

darul75 commented 9 years ago

glad to hear