ionic-team / ionic-team/ionic-docs

content: document alternative to dismissOnPageChange (ionNavWillChange, ionNavDidChange)

Ouverte
#846 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
content
Langage dominant
MDX
Étoiles
621
Forks
3.2k
Merge moyen
1 j 2 h
PR mergées (30 j)
86

Description

**URL**
https://github.com/ionic-team/ionic-framework/blob/main/BREAKING_ARCHIVE/v4.md#overlays

**What is missing or inaccurate about the content on this page?**
The doc says that as a workaround for the removed dismissOnPageChange, `there are global events (ionNavWillChange, ionNavDidChange) that you can listen to in order to detect when navigation occurs.`

I can't find any documentation anywhere on how to actually use ionNavDidChange, so this is not a great proposed alternative.

I managed to get it working using this code in app.component.ts to subscribe to Angular router events:

```
router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
// Do something
}
});
```
Perhaps this should be documented as an alternative to dismissOnPageChange.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.