Tab content gets removed

Hey Ninjas, anyone can help me
I have an app which has side menu navigation.
Now in one view which shows entry details I have two tabs.
My problem is that as soon as I change tab the content of the other tab is gone.
My view code is like this:

<ion-view view-title="main view title">

<ion-tabs tabs-type="tabs-icon-top" class="tabs-striped tabs-color-active-positive">

   <ion-tab  title="General">

<ion-content class="has-subheader padding text-center">

   Test general
  
</ion-content>
   </ion-tab>

   <ion-tab title="Documents">

<ion-content class="has-subheader padding">

test document

   </ion-content>

   </ion-tab>

</ion-tabs>

</ion-view>

Pen with the issue: http://codepen.io/anon/pen/mVVQrV

hey,

check this codepen

delete the -> $ionicConfigProvider.views.maxCache(0);
and small changes to the html

Hello ItamarCohen

Thank you for your reply. But unfortunately I need to have this $ionicConfigProvider.views.maxCache(0); in place. Since I need for the app not to cache any of the views.

So any other way to turn of caching globaly and have the tabs working properly?

you can use to route the state of each tab you have full example in ionic docs

To be more precise with my issue the scenario is this:

The scenario:

  1. the App is with side menu navigation.
  2. In one of the views I have list of entries
  3. When an entry is clicked It will open a new view ( overview) which has two tabs: general and documents.

What I have:

  1. I have a state which leads me from the list to the overview view : url: ‘/mySubmissions/:submissionId’,

  2. In the template for this state I have the HTML with the tabs navigation .

Where I get stuck :frowning:

  1. I can’t seem to find a good way to toggle between tabs and in the same time transfer the :submissionId parameter .

  2. I do not know how to set up the routes properly So this will scenario will work.

ANY HELP IS MORE THEN WELCOMED

hi,

check this codepen

Thank you @ItamarCohen

I checked your pen and accordingly modified my pen and my project now it all works as intended.

Here is my pen in case anyone else needs it: http://codepen.io/joconolimits/pen/pgyNYP

1 Like