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

Angular URL serializer to properly handle URLs that start with query parameters directly (without a path adding trailing slashes Angular

 Example Code The key requirement: In the parse method, I added special handling for URLs that start with query parameters: If the URL start...

Best for you