Hi All,
i need some help with the IonSlide indexing,
so im trying to create a button for slider to show the next one slide
found some source in the internet and following,
import { Component, OnInit, ViewChildren} from '@angular/core';
import { IonSlides } from '@ionic/angular';
@ViewChildren('slides') slides: IonSlides;
selectedSlide: any;
next()
{
this.selectedSlide.getActiveIndex().then((slidesIndex) =>
{
if(slidesIndex == 1)
{
console.log("Done Slider");
}
else{
this.selectedSlide.slideNext();
}
}
)
}
<ion-slides #slides pager="true" [options]="slideOpts" (ionSlideDidChange)="ionSlideChange(slides)">
<ion-slide>1</ion-slide>
<ion-slide>2</ion-slide>
</ion-slides>
<ion-button class="tour-button" (click)="next()">
<div class="parent">button</div>
</ion-button>
and then got an error the getActiveIndex seems not working,
I look few resources from the internet but still cant make work in my side
how can I get the indexing working for my slider button?
Sorry if I miss some very basic since im really new on this Ionic also angular