Prerak Tiwari
Prerak Tiwari

Reputation: 3476

Passing data from child tab to parent tab in Ionic 2

I know we can pass data to the child tab from parent tab by doing following as described here:

<ion-tabs>
 <ion-tab [root]="chatRoot" [rootParams]="chatParams" tabTitle="Chat" tabIcon="chat"><ion-tab>
</ion-tabs>

Is there any way I can do the reverse stuff i.e passing the data from child tab to parent tab.

I have the following scenario: 1. I have "next" button on the the Tabs(parent) page. 2. When user selects the value on the child page then I need to navigate the user to next page based on the selected value when he clicks next.

Upvotes: 3

Views: 3044

Answers (1)

nahoang
nahoang

Reputation: 2478

I have met your problem. you should use Events in Ionic 2 for sending and responding to application level across your app. So you can send data from child tab to parent tab and update status for it.

Upvotes: 5

Related Questions