A page as a child component of a different page


#1

I’m using the custom NavController to handle my page navigation in my Ionic app.

I would like to have one page as a child component of a different page.

My scenario is letting pair’s of pages each share a separate instance of a service and not having one global service for all pages.

see this question http://stackoverflow.com/questions/41973447/angular2-share-data-between-pages-with-multi-instances

Is there a way to do so?


#2

Multiple copies (or an array or list) of the service in NgModule.

On StackOverflow, Gunter’s many, many comments are all correct.

A reason to follow his suggestions is that to build your desired pairing, it’ll be very difficult for others to read the code. After all, your S/O project isn’t laying out the M-D design pattern. It’s laying out M-D-M-D-M-D… and that’s messy. …Or are you going for TableOfContents-Master-Detail? It’s ambiguous.