1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

I am using IonicRouteStrategy and I want to preserve the state of the component without...

Discussão em 'Angular' iniciado por SLIW, Outubro 7, 2024 às 10:22.

  1. SLIW

    SLIW Guest

    I have several routes. After loading on the main page, I expect that the component will not change its state and will live even after switching to other pages. But if you do not load on the home page and go to it. Then after leaving it, it is completely destroyed. I use ionic and its routing policy.

    ionViewDidLeave() {
    console.log('dead')
    this.navigationService.modalEventShowOpen.next(false)
    this.destroy$.next()
    this.destroy$.complete()
    }
    ngOnDestroy() {
    // отписываемся от всех подписок
    console.log('dead')
    this.destroy$.next()
    this.destroy$.complete()
    }


    I checked it through ngOnDestroy, and through ionViewDidLeave. And each time the component died. I expected him to keep his condition.

    Continue reading...

Compartilhe esta Página