angular-slider / angularjs-slider

Slider directive for AngularJS 1.X. No dependencies and mobile friendly.
http://angular-slider.github.io/angularjs-slider
MIT License
1.23k stars 498 forks source link

Slider element id or data attribute #650

Closed jpaulo1987 closed 5 years ago

jpaulo1987 commented 6 years ago

Question: is there a way to dynamically find out the id or data-attribute of a slider that triggered an 'onChange' event (inside the onChange function)? I can not use the "sliderId' option because i have multiple sliders on the same page that share the same options object (since the options for all of them are the same, except for the id).

ValentinH commented 6 years ago

The only way is to use the sliderId. You can definitely share the options between the sliders and just set the id for each of them by creating a new object like: {...options, id: '123'} or with Object.assign().

ValentinH commented 5 years ago

Closing as there was no answer for a while. Comment to re-open 😉