angularjs-slider icon indicating copy to clipboard operation
angularjs-slider copied to clipboard

Using stepsArray with MomentJS instances doesnt

Open evenicoulddoit opened this issue 8 years ago • 3 comments

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).

evenicoulddoit avatar Jan 13 '17 10:01 evenicoulddoit

Indeed, stepsArray should contains values that can be compared with "===". The only exception are Date instances that are handled as well.

ValentinH avatar Jan 15 '17 21:01 ValentinH

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?

evenicoulddoit avatar Jan 15 '17 21:01 evenicoulddoit

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.

ValentinH avatar Jan 16 '17 18:01 ValentinH