Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49308

ionViewDidEnter is not invoked on leaving a pushed page

$
0
0

@Dovel wrote:

I have two pages, the home page with ionViewDidEnter (also tried ionViewWillEnter) and another page which will pushed with the NavigationController from the first page.
When I pushed the second page and close it again (navigate back) the event ionViewDidEnter is not involked agains. It behaves like ionViewDidLoad.
What should I do to have an event which will invoke if a page will enter and become the active page?

This does not work (snippets):

// First page
onButtonClick() {
  this.navCtrl.push(SecondPage);
}

// On second page navigate back to close the the page
// Back on first page.

ionViewDidEnter() {
  // Only called once on first enter.
  // Not called on navigation back from second page.
}

I know why. The first page will not close on pushing another page. But it becomes inactive and active again on navigation back. In the documentation of this livecylce-event this should work. Becuase the first page becomes active again.

The only solution I currently have is using setRoot and implement back navigation manually.

Posts: 12

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49308

Trending Articles



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