Howto use ion slider in Ionic 6 - angular

First, update to the latest version of Ionic:

npm install @ionic/angular@latest

Once that is done, install the Swiper dependency in your project:

npm install swiper@latest


Add code homeslider.page.html

<ion-content fullscreen class="ion-padding" scroll-y="false"> <swiper-container> <swiper-slide *ngFor="let s of slides"> <img src="{{s.image}}" /> <div class="slide" > <h2>{{s.title}}</h2> <p> {{s.para}} </p> <ion-button color="tertiary" (click)="goToHome()" shape="round"> {{s.btnText}} </ion-button> </div> </swiper-slide> </swiper-container> <!-- slides.component.html --> </ion-content>

Add homeslider.ts


import { register } from 'swiper/element/bundle'; register();











No comments:

Post a Comment

CPU vs GPU Architecture

  CPU vs GPU Architecture CPU (Central Processing Unit) and GPU (Graphics Processing Unit) have distinct architectural differences, optimize...

Best for you