Ion-slide-box crash on phonegap app


#1

If I use NG-repeat to populate ion-slides in ion-slide-box, then phonegap app crashes if large object is assigned to NG-repeat.
Like if length of object is around 20-30 then NG-repeat works but if length is around 50-60 then app crashes without throwing any error.

I tried to us ’ limitTo ’ with angularjs but it didn’t updated ionic slide box.


#2

Taking a look into this…


#3

You could do something like this.

 <ion-slide-box  on-slide-changed="slideChanged(index)">
      <ion-slide ng-repeat="group in groups">
        <ion-content ng-show="$index >= (currentSlide-1) && $index <= (currentSlide+1)" > 
            Group {{group.name}}
          </ion-item>
          <ion-item class="item-accordion"
          ng-repeat="item in group.items">
            {{item}}
            <img src="http://placehold.it/350x150">
          </ion-item>
        </ion-content>
      </ion-slide>
    </ion-slide-box>

This will hide the slides if they are not the previous, current, or next slide


#4

Thanks a lot, let me try this.


#5

Yeeeeeeeeeeeeeee.
You are a life saver :smile: :smile: :smile:

It worked like a charm.

I thought that the problem was, the size of array. So i tried to implement fixed length DEQUEUE. It did solve the issue of crash but, behaviour was getting weired. Whenever i swiped, it was jumping to ->next -> next element of DEQUEUE.