Thanks and sorry for giving you too much trouble. Since four days or so, I am now using my GlobalService.ts to pass my CurrentMedia. I did not factor it out as you did above as my GlobalService still holds only few items at this time.
So yeah, few days ago, I understood (or think so) how the framework wants things to happen.
My app is working regarding the switching of players upon Media user selections or scheduler changes. I was more interested in fully understanding what I was dealing here with (computer science curiosity). The calls from pages to page was just a way to debug and trying to understand what is taking place.
Here is the what the lessons I take from my plunker exercise on this issue:
-
If a page’s template is based on a property changes affected by only the page, then it’s OK for this property to reside in the page itself.
-
However, if the property needs to be changed by other “agents” outside the page, then it HAS to be put in a service and injected.
-
Don’t inject a page into another page to get access to it
Regarding not wanting to use NavController.push() at least in beta11
- it created too much nav history from a user session selecting tabs, causing painful exit from the app.
- also popping the players (shared tab or separate pages for that matter) would kill/destroy my player object.
That’s why, way back, I posted the following which remained unanswered and I had to find an alternative to keep moving with my port.
The alternative was to (A) share a tab for all players to keep them alive, and (2) use tabs.select() to avoid navigation history. I hope this clarifies why I stayed away from pushing pages or tabs.
I value all your responses and the tremendous help you provide on this forum.
Thank you.