ionic-team / ionic-team/ionic-docs
content: The IonSlides Angular migration guide should have "Notes" about the breaking change on Event handling
- 主要言語
- MDX
- スター
- 621
- フォーク
- 3.2k
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 86
説明
### URL
https://ionicframework.com/docs/angular/slides#events
### Issue Description
When following the migration guide to switch using Swiper instead of IonSlides, I found one breaking change.
That is the triggered event is no longer part of NgZone.
This is also mentioned in the Swiper document.
https://swiperjs.com/angular#swiper-component-events
> Note that Swiper Angular component all events emits outside of NgZone for better perfomance. Dont forget to use `ngzone.run` or ChangeDetector if you need to change view (e.g slides) in event handlers (e.g `slideChange`).
I think this should also be mentioned in the Ionic docs.
Below is a small sample:
In HTML, I put a testVariable both inside and outside of Swiper.
```
{{testVariable}}
Slide1, {{testVariable}}
Slide2 {{testVariable}}
Slide3 {{testVariable}}
```
In component code, if I don't surround the code with ngZone.run, only the testVariable inside Swiper is updating, the one outside of Swiper never changes. IonSlides doesn't have such behavior change.
```
onSlideChange() {
this.ngZone.run(() => {
this.testVariable++;
});
}
```
コントリビューションガイド
調査の方向性
Open the Angular migration guide at the documented slides Events section and compare its event-handling guidance with the linked Swiper Angular documentation. Add a note describing that Swiper events run outside NgZone and explain when ngZone.run or change detection is needed; done when the breaking change is clear in the guide.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100