Ionic onSlideChanged events delay

2019-08-23 12:06发布

问题:

I am using the ion-slides, and I get some events via:

(ionSlideDidChange)="onSlideChanged()"

I use this function to get the last slide:

onSlideChanged() {
this.lastSlide = this.slider.isEnd();
}

Than I use this.lastSlide in another directive [hidden] to show or hide some stuff in the next slide.

However there is a slight delay right after the next slide is shown, so after 1 second or less than one second the content is hidden as soon as slider reach to this last slide.

I have tried to use (ionSlideWillChange) instead (ionSlideDidChange) but I it has a delay still.