angularjs-slider
angularjs-slider copied to clipboard
Using stepsArray with MomentJS instances doesnt
Demo: http://jsfiddle.net/5e78mxha/
The demo above works by using the vm.sliderOptions
workaround, but using the vm.sliderOptionsBroken
does not.
Expected behaviour
Using the stepsArray
with MomentJS instances and using the translate
option to translate the values to string literals should work.
Actual behaviour
Fails to bind correctly, though you can translate the values to string literals and use these are part of the stepsArray
- the problem here is that the bindings are not what you'd what (i.e. the MomentJS instances).
Indeed, stepsArray should contains values that can be compared with "===". The only exception are Date instances that are handled as well.
But having not meticulously looked through the code I'm not sure why ===
equality checking would make the above infeasible? The rz-slider-model
and rz-slider-high
values are both members of the stepsArray
- I'm not attempting to compare "similar" moment instances?
Yes you are right. At first sight, I don't understand what can be the issue and also, I haven't test this slider with ES6 so I don't know if your arrow functions are ok or not.
Anyway, I'm not maintaining this project anymore (or very rarely at least) so I can't help you much.