Well, I already inserted these code :
import { register } from ‘swiper/element/bundle’;
register();
to the app.component.ts
and already added CUSTOM_ELEMENT_SCHEMA into my preview1.module.ts
preview1 is the name of the page where I would like to implement the swiper
my html code for that :
<ion-content [fullscreen]=“true”>
<swiper-container [config]=“swiperConfig”>
Slide 1
Slide 2
Slide 3
when I run the application, it just shows the slide 1 to 3, it doesn’t do the slide thingyy
Check the code. Need to set autoplay for the swiper.
ngAfterViewInit(): void {
const swiperEl = document.querySelector('swiper-container');
if(swiperEl)
{
Object.assign(swiperEl, {
autoplay: {
delay: 1500,
},
pagination: {
el: '.swiper-pagination',
type: 'bullets',
},
navigation: true,
zoom: {
maxRatio: 5,
},
});
}
For html
<swiper-container effect="flip">
<swiper-slide *ngFor="let img of swiper_images">
<div class="swiper-zoom-container">
<img [src]="img" style="max-width: 500px;"/>
</div>
</swiper-slide>
</swiper-container>
vdo at @techbinomial