Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49215

How to execute the constructer function everytime when i click the tab pages in ionic2?

$
0
0

@saty932 wrote:

Right now i have three tabs pages.For each tab page i have some api calls in constructer but the problem is it’s only executing for the first time whenever i click that tabs.I am navigating to each tab through ion-tabs.

<ion-tab [root]=“tab1Root” tabTitle=“Offers” tabIcon=“custom-icon1” >
<ion-tab [root]=“tab2Root” tabTitle=“Favorites” tabIcon=“custom-icon2”>
<ion-tab [root]=“tab3Root” tabTitle=“Settings” tabIcon=“custom-icon3”>

export class TabsPage {

tab1Root = OffersPage;
tab2Root = FavoritesPage;
tab3Root = SettingsPage;

constructor(public app:App,public authservice:AuthService,public navCtrl:NavController) {

}

}
For all other pages i am loading into this tabs are working fine because i am using navcontroller to push the pages into it but how can i execute the api calls in tabs pages?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>