Issue
I am using the Swiper Elements Web Component in Angular and following the example here where an event is bound in the template using Angular like event binding in the template.
Note I have not seen this syntax in the official docs or examples.
<swiper-container
(slidechange)="slideChange()"
>
The slideChange
function is never called.
Should this syntax work and if so, why is it not working here?
Solution
As mentioned in the documentation you should prefix all the event with swiper
Try this:
<swiper-container
slides-per-view="auto"
space-between="30"
(swiperslidechange)="slideChange()"
>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
<swiper-slide><img src="https://cataas.com/cat" /></swiper-slide>
</swiper-container>
Answered By - Chellappan வ
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.