Ion-slides initialSlide not working with ng-repeat

Hi,
Just started having a small test with <ion-slides> and ng-repeat on <ion-slide-page>.

Apparently, when you specify an initialSlide on the options object, it won’t work in conjuction with ng-repeat, instead, the first slide will be shown.

I made a quick fix (and got it working) on ionic.bundle.js here:

I suggest you add it too or find some other way to solve this, or of course, tell me if I had something wrong…

UPDATE:
My use-case was to load the slides via ajax on page load, so the solution I made worked for me well, but for use-cases where people constantly change the content inside the slider (i.e add/remove slides or change the ng-repeat collection) it will cause an effect of returning to the initialSlide every time the slider updates… The correct solution should be a way of lazy-loading the slider so that if it’s content is derived from ajax then just after the initial loading it will go to the initial slide.

2 Likes

well done .thank you for this fix