Ion-slide-box $index assigned wrong value


#1

$index = 0, 1, 2, 3 even though an array of only 2 objects are supplied. Please see

http://codepen.io/anon/pen/KpQqzm

Open dev-tool and check the “console.log()” printout.


#2

I guess this is the “feature” of slider (special case if you have 2 slides, as they say in the comment) because it requires looping animation (both does-continue and auto-play params). In that special case they are cloning DOM elements and that is why you have 4 elements.
https://github.com/driftyco/ionic/blob/master/js/views/sliderView.js, lines: 58-62.
So I guess you’ll have to take that special case into consideration and change your code.


#3

Thanks for the explanation. I have to say it is weird to require a lib user to take care of such a SPECIAL case !