“Why does Navcontroller.Push() creates and destroys the page I want to travel to with each invocation”.
Currently I have 4 tabs used for media selection plus two others to
host player1 and player2, for a total of 6 tabs (I will have more
players soon). I really would like to keep only the 4 tabs used for the
media selection and navigate to the players pages. However, I
tried using .push( Player1Page ) to navigate to the appropriate player
upon a media selection and I noticed that the players pages get
re-created every time they are visited.
IMPORTANT DESIRED BEHAVIOR: Having more than 4 tabs seems not
practical UX for phone in portrait mode. however hosting a player’s page
in tab seems to keep its instance live and allows the media to continue
playing, while the user can still browse the 4 tabs for media selection
(in search perhaps of other contents) but can still return to the
current player. I would like to preserve this functionality.
Popping the player page in the foreground with push() is fine, the user
should be able to exit the player page, which should stay live, ie
playing a video, a slide show, …, the sound can still be heard. I
would provide a mechanism like a floating button in the media selection
tabs to return to the current player (when it is still active).
I put the following plunker together to demonstrate the current
behavior of NavController.push( Player1 ) causing Player1 page instance
to be created on each navigation.
Please feel free to upgrade the dependencies to the latest builds. I am not comfortable doing it with the plunker (config.js).