Nav-inception: Communication between ion-nav components

Hello and thank you for the Nav-inception concept/implementation. I have one question, is it possible somehow to push a Page from one Nav to another?

I have right now the following code and I would to push a page from the menu to my main content.

<ion-split-pane>
  <ion-menu [content]="content">
    <ion-nav [root]="menuPage"></ion-nav>
  </ion-menu>
  <ion-nav [root]="rootPage" main #content></ion-nav>
</ion-split-pane>

Thanks in advance!
George

1 Like

I think the easiest might be to setup a service where you use rxjs and push the pages through it, like: https://angular.io/docs/ts/latest/cookbook/component-communication.html#!#parent-to-view-child

And then in the main view decide if you want to push to the stack or do a set root.

Hello @chillax,
thanks for your suggestion.

More or less I followed the same pattern by publishing and subscribing to Ionic 2 core Events https://ionicframework.com/docs/v2/api/util/Events/. I didn’t know that amazing feature before.

Events is a publish-subscribe style event system for sending and responding to application-level events across your app.

Thanks again!
George

Thanks for the tip @gtsopour - glad you got it solved too. :slight_smile: