Ionic2 root nav

0

I'm developing an application in Ionic 2 and the first screen Page1 and I run:

this.app.getRootNav().push(Page2)

My problem is that when I click the back button I want to execute the ionViewDidEnter() method of Page1 .

It only executes this method with this.nav.push(Page2) for example.

I wanted it to work with getRootNav .

    
asked by anonymous 17.10.2017 / 01:39

2 answers

-1

Victor, try to ionViewWillEnter . To get clearer, the ionViewWillEnter will fire whenever you enter that page.

Now the ionViewDidLoad will be cached and therefore will trigger actions only once.

    
23.10.2017 / 21:44
-2

getRootNav deprecated

Try with getRootNavId

If you are using Api Http And in the case of firebase you just use ngOnInit

    
09.12.2017 / 23:04