diff --git a/src/pages/angular.mdx b/src/pages/angular.mdx index 758309dc..cbc80c08 100644 --- a/src/pages/angular.mdx +++ b/src/pages/angular.mdx @@ -118,7 +118,7 @@ export class AppComponent { } ``` -`[config]` +Using `[config]`: ```js import { Component } from '@angular/core'; @@ -287,9 +287,36 @@ export class AppComponent { Swiper component supports all Swiper events, including additional `swiper` event that returns swiper instance as soon as posible. For example: +use `EventsParams` for typing. Parameters are always returned as an array even if only one paramter passed. -```html - +```ts +import { Component } from '@angular/core'; + +import { EventsParams } from 'swiper/angular'; + +@Component({ + selector: 'app-swiper-example', + template: ` + + Slide 1 + Slide 2 + Slide 3 + + `, +}) +export class AppComponent { + onSwiper(params: EventsParams['swiper']) { + const [swiper] = params; + console.log(swiper); + } + beforeTransitionStart(params: EventsParams['beforeSlideChangeStart']) { + const [swiper, speed, internal] = params; + console.log('beforeTransitionStart, speed: ' + speed); + } +} ``` ## SwiperSlideDirective props