Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

Ionic4/Angular How do I force ion-router to destroy pages in the component stack

$
0
0

@joelmeaders wrote:

I hope this is simple. I need Ionic to not keep some/all pages/components in the “stack” once the page is navigated away from. This isn’t an issue in realtime apps but with apps without realtime connections it becomes an issue.

For Example, a user sees a list of items. A user clicks on an item which navigates to a new page and the user edits that item. They click to go back (menu button, toolbar back button, browser button) and the data is still the old data because the ion-router keeps the old page in the stack.

I need the page to be destroyed when the user navigates away from a page. I would prefer not use Ionic lifecycle events because it’s out of my control if I am told to use a different framework. Creating some service to communicate “hey re-run your ngOnInit lifecycle event” is overkill. The only Angular event I use is OnDestroy because my apps are developed reactively using observables for everything.

There were a few similar questions in the past but they only had workarounds.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>