Answers for "ionic add next button slides"

1

ion slides next by button

import { ViewChild } from '@angular/core';
import { IonSlides } from '@ionic/angular';
...
@ViewChild('slides') slides: IonSlides;
next() {
	this.slides.slideNext();
}

prev() {
	this.slides.slidePrev();
}
...
// in html
<ion-slides #slides>
   <ion-slide>
   </ion-slide>

   <ion-slide>
   </ion-slide>

  <button type="submit" float-left ion-button  color="primary" class="btnPrev" (click)="prev()">Prev</button>
  <button type="submit" float-right ion-button color="primary" class="btnNext" (click)="next()">Next</button>
     
</ion-slides>
Posted by: Guest on August-28-2020
0

ionic add next button slides

import { IonSlides} from '@ionic/angular';


 export class HomePage {

      @ViewChild('mySlider')  slides: IonSlides;

      swipeNext(){
        this.slides.slideNext();
      }

    }
    
    
    <html>
     <ion-slides pager="true"  pager="false" #mySlider>

   <ion-slide>
   </ion-slide>

   <ion-slide>
   </ion-slide>

    <ion-button (click)="swipeNext()">Next</ion-button>

 </ion-slides>
 <html>
Posted by: Guest on April-19-2020
0

ionic add next button slides

// IonSlides as type but it didn't help (ionic v6.17.1)

@ViewChild('slides', {static: true}) slides: ElementRef;

swipeRight() {
	this.slides.nativeElement.slideNext();
}
//{static: true} is optional
Posted by: Guest on September-15-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language