I thought ionic does just single page apps. Or more Angular does.
In the app.component.ts we setup the Nav and menu values.
@ViewChild(Nav) nav: Nav;
Nav is really global.
Different types of pages.
Rootpage (ionic puts a menu in the nav bar)
A new pushed page. (Ionic puts a back button in the nav bar).
Or a Modal which overlays the current page. (I guess from the NavControler point of view nothing has changed).
But all of these use the hardware back button.
From a modal, dismiss.
From pushed page, pop.
From root page close app.
From the document about modal its kind of hard to understand how modal and navControler work.
A modal uses the NavController to present itself in the root nav stack. It is added to the stack similar to how NavController.push works.
Does that mean a Modal is a root page or a pushed page?
All I know is that if I am on a root page, I do a modal the this.nav.getActive as the root component value. The this.nava.length is still 1.
I get the viewDidLoad and videDidEnter. It seems like that means you would have set the back button up on every page.
You entered page one, register back button function, you leave page one set the back button back to default behavior. Page 2 doe the same thing again?