raj_tx
raj_tx

Reputation: 239

how to refresh the tabs page in Ionic

I have a page called Matches and feeds. In the matches pages I have 3 tabs as below

<ion-tab [root]="tab1Root" tabTitle="Applied" id="active" #active></ion-tab>
        <ion-tab [root]="tab2Root" tabTitle="Failed"></ion-tab>
        <ion-tab [root]="tab3Root" tabTitle="Saved"></ion-tab>

So when I navigate from feed page to matches page I want to navigate to the tab1Root tab. When from some other page I navigate or click on the matches page Then i want it to navigate to the tab1Root automatically and refresh the page. How can I do it? When I navigate from the feeds page to matches page I'm not getting the output which is present in my tab1Root IonViewDidEnter(). How can I solve this issue?

Upvotes: 0

Views: 3794

Answers (1)

Jonathan
Jonathan

Reputation: 350

You should use ionViewWillEnter instead of ionViewDidLoad to reload a tab page every time the user enters this page.

To switch programmatically to another tab:

this.navCtrl.parent.select(0) //your tab index

Upvotes: 5

Related Questions