Hi I want to use the ionic slide to generate dynamically the list view e.g. for the months of a calendar and load/add additional months only when i reach the beginning/end of the list.
for the ending is very simple
template
<ion-slides [initialSlide]="1" (ionSlideReachEnd)="reachedEnd($event)" (ionSlideReachStart)="reachedStart($event)">
<ion-slide *ngFor="let item of months">
<h1>Slide {{item}}</h1>
</ion-slide>
</ion-slides>
component
months = [1, 2, 3, 4]
reachedEnd(event) {
this.months.push(//new item);
this.slides.update();
}
reachedEnd(event) {
this.months.unshift(//new item);
this.slides.update();
}
for the reachedStart part it’s more tricky and I haven’t been able to figure out how to implement it.
The obvious problem is that I need to place it at the beginning of the array with unshift or [first, …current] but that will cause the ionic slider to behave strangely.
Does anyone has suggestions? Thanks!