Skip to content

Correct names for swiper element events use "swiper-" prefix #3370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/angular/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,22 @@ Below is a full list of event name changes when going from `ion-slides` to Swipe
All events available in Swiper Element can be found at <a href="https://swiperjs.com/swiper-api#events" target="_blank" rel="noopener noreferrer">https://swiperjs.com/swiper-api#events</a>.
:::

::: note
https://swiperjs.com/element#events says "All Swiper events are available as native DOM events but with lowercase names and swiper prefix (prefix configurable with events-prefix). So you need to prefix the (init) method with either **swiper** or another prefix of your choice.

```
<swiper-container
(swiperinit)="mySlidesDidInitFunction()" // default event prefix is "swiper"

OR

<swiper-container // set event prefix to "whatever"
events-prefix="whatever"
(whateverinit)="mySlidesDidInitFunction()"
```

:::

## Methods

Most methods have been removed in favor of directly accessing the properties of the Swiper instance. To access the Swiper instance, first get a reference to the `<swiper-container>` element (such as through `ViewChild`), then access its `swiper` prop:
Expand Down