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

add the option to use ticksArray as array of objects, with legend and value properties #662

Closed vdiez closed 5 years ago

vdiez commented 5 years ago

same as we do with steps array, but to customize the ticks without limiting the selection steps.

I know this can be already done with a variety of methods, but AFAIK only with functions. In my case I store these labels in a mongo db, so storing logic is not ideal. Putting those labels in a table of objects without limiting the selection as stepsArray solves both issues, storing and displaying.

codecov-io commented 5 years ago

Codecov Report

Merging #662 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #662   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         970    974    +4     
=====================================
+ Hits          970    974    +4
Impacted Files Coverage Δ
src/rzslider.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 64c3f86...e6f070f. Read the comment docs.

ValentinH commented 5 years ago

Hey @vdiez, thanks for this PR!

Could you create a JSFiddle showing how to use this option? For this you can fork the example one from the ReadMe and point the script (angular-slider.js) to your repo instead of this one. You'll need to run the build script on your PR to generate the different needed files.

Also, please provide a unit test for this option so we keep the coverage at the same level as before.

Thanks :)

vdiez commented 5 years ago

Hi @ValentinH,

fiddle here: http://jsfiddle.net/3jgzv4wc/1/

Cheers

ValentinH commented 5 years ago

Released under 6.7.0 🎉