How to save a tab when a new page is clicked?

When I click on a new tab like this in my controller:

this.nav.push(EditPage);

the tab disappears. How can I save a tab?

Fig. below:

enter image description here

When a new page appears: enter image description here

+2
source share
1 answer

You need to add tabSubPages:false configuration in ionicBootstrap as follows:

 ionicBootstrap(MyApp, [], { tabSubPages:false }); 

Thus, and since each tab has its own history stack, and the NavController instances introduced into the @Components each tab will be unique to each tab, a new page will open on the current tab.


UPDATE:

Please note that with the new version of Ionic 2.0.0-beta.11 (2016-08-05) this config has been renamed to tabsHideOnSubPages , so this should be:

 ionicBootstrap(MyApp, [], { tabsHideOnSubPages:false }); 

Previous names are out of date. They will still work in the current version, but will be removed in the future, so please update the new names.

+2
source

Source: https://habr.com/ru/post/1263298/


All Articles