Access Same View From Multiple Tabs


#1

This is a codepen that I’ve seen pasted multiple times in this forum to demonstrate how tabs work > http://codepen.io/ionic/pen/odqCz

One thing I do not understand is line 23 of the Javascript file where we assign the view tabs.facts to home-tab. This makes sense if you will only access the tabs.facts from within the home tab but this is not always the case.

So right now the js looks like this…

.state('tabs.facts', {
   url: "/facts",
   views: {
      'home-tab': {
         templateUrl: "templates/facts.html"
      }
   }
})

How could I change this state so that I can access it from any of the tabs and still get the same affect with the back button and route saving as I do now.


#2

I am having the same problem. Posible beta14 view cache freeze app when visit shared tab view

I have to duplicate the routes for each tab, but cause some problem


#3

Hmmm. First off thanks for chiming in. Creating new views does in fact solve my problem. However, that is a bit messy/redundant and I am not a huge fan of the solution.

Doing something like this…

.state('tabs.factsHome', {
   url: "/facts",
   views: {
      'home-tab': {
         templateUrl: "templates/facts.html"
      }
   }
})

.state('tabs.factsProfile', {
   url: "/facts",
   views: {
      'profile-tab': {
         templateUrl: "templates/facts.html"
      }
   }
})

And the fact that you are saying this has issues with caching which I have not gotten to yet also makes me weary of this solution.


Posible beta14 view cache freeze app when visit shared tab view