Ionic 4 - Angular 6: How to control Ionic router history to stop cache a view component?
Had the similar issue 2 days ago. i am now using the ionic lifecycle hook ionViewWillEnter
. and by forcing the logic in this hook i achieved my desired results.
Let me know if this is helpful :)
I solved my problem using Ionic's life cycle hooks to fire the behavior needed, since Ionic does not destroy og init Angular components from the stack if previously visited. This is a longer topic, and it seems some things in Ionic stack control is not 100% fixed yet. Here are the hooks I routinely implement now to make things work:
- ngOnInit
- ionViewWillEnter
- ionViewDidEnter
- ionViewWillLeave
- ionViewDidLeave
- ngOnDestroy