I’m new to hybrid development with Ionic 2.
How can I create a quit button on my ion-tab?
<ion-tab [root]="tab1Root" tabTitle="Reddit" tabIcon="home"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
<ion-tab [root]="tab3Root" tabTitle="Setting" tabIcon="construct"></ion-tab>
How would you look in Tab.ts?
Can you be more specific in what you are trying to accomplish?
Where do you want the button to be? I don’t believe there is anyway to add a button to a tab. Take a look at the Tab Component API. You can add icons, titles, and badges to tabs.
Also what do you want the quit button to do? Quit all the tabs or just quit out of that one tab?
Hi plmetz, thanks for the reply
In my project I need to have a button that closes the application (close).
I do not know how to implement this in the tabs.ts
What have you tried so far?
It’s not in the documentation but you can use
platform.exitApp() to exit the application. For buttons in tabs you need to place the buttons in the individual tab pages.
tabs.ts is just to setup the tabs navigation bar.
I’d suggest taking a closer look at the tabs documentation.
After reading that over post some code if you still need some help.