ionic-team / ionic-team/ionic-docs

content: document alternative to dismissOnPageChange (ionNavWillChange, ionNavDidChange)

Abierto
#846 0 comentarios 0 reacciones 0 asignados Ver en GitHub
content
Lenguaje dominante
MDX
Estrellas
621
Forks
3.2k
Merge medio
1 d 2 h
PR fusionados (30 d)
86

Descripción

**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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.