Hi, I'm using ng-slider on a project where I update a led's light intensity with the value of a slider. Since ng-slider only provides onstatechange() (which is called many times per second and would flood the communication channel to the hardware) I added a callback function to be called only when the user is releasing the slider pointer. This callback function can be set as "options.callback".
I also needed a reference to the HTML element that holds the slider in case I have more than one slider (e.g. in a ng-repeat) so I can update the background color to match the values selected on the sliders. For this, I added the element as a parameter to both functions (callback and onstatechange).
Hi, I'm using ng-slider on a project where I update a led's light intensity with the value of a slider. Since ng-slider only provides onstatechange() (which is called many times per second and would flood the communication channel to the hardware) I added a callback function to be called only when the user is releasing the slider pointer. This callback function can be set as "options.callback".
I also needed a reference to the HTML element that holds the slider in case I have more than one slider (e.g. in a ng-repeat) so I can update the background color to match the values selected on the sliders. For this, I added the element as a parameter to both functions (callback and onstatechange).
For those interested I made a patch. I can attach only images (?!), and markdown is messing it up, so get it here: https://app.box.com/s/txgszkd5kb2e7oh4jnam