# Multiple Tab Views Issue

**URL:** <https://forum.ionicframework.com/t/multiple-tab-views-issue/15617>\
**Category:** ionic-v1\
**Created:** [January 13, 2015, 7:13pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617 "2015-01-13T19:13:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 13, 2015, 7:13pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/1 "2015-01-13T19:13:41Z")

</div>

Hi everyone,

I’m starting to switch my app to Ionic Framework. Great work so far guys!

I’m having an issue with multiple states with tabs and views. I don’t know much about moving this to codepen or I would do that, but here is the ZIP of my project. It’s a modified version of the ionic start side menu project.

[Link to ZIP](https://www.dropbox.com/s/lulh34z7uc5ce31/ionic-starter-sidemenu-modified.zip?dl=0)

If you have node, you can run the included minimized web browser via command line, easily enough.

How to reproduce:

1. Start page Welcome
2. Click button “Logged In Checked In”
3. Click right menu open
4. Click Tabs
5. Click through tabs
6. Open right menu
7. Click Tabs2
8. Even though URL is Tabs2, Tabs is being displayed

Forgot to include another little bug:

When clicking through the tabs, the title in the nav bar isn’t changing each time. It’s random on when the title gets updated.

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 14, 2015, 3:43pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/2 "2015-01-14T15:43:53Z")

</div>

Anyone able to download and give my project a quick run? Is it something in Ionic or my route configuration that is messing with the multiple tab states? Thanks.

---

<div class="post-metadata">

**Author:** ![ItamarCohen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itamarcohen/32/115653_2.png) [@ItamarCohen](https://forum.ionicframework.com/u/ItamarCohen)\
**Post date:** [January 14, 2015, 4:36pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/3 "2015-01-14T16:36:49Z")

</div>

hi ,  
check this codepan and compere it to yours.

[http://codepen.io/itamarCohen/pen/yygvrZ](http://codepen.io/itamarCohen/pen/yygvrZ)

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 14, 2015, 5:41pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/4 "2015-01-14T17:41:33Z")

</div>

This example isn’t really comparable to mine. I’m using side menu + tab + tab2, where this is just 1 tab with multiple states.

When I have 1 tab state, everything works fine it seems, when I added the 2nd tab state, is when there’s an issue.

---

<div class="post-metadata">

**Author:** ![ItamarCohen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itamarcohen/32/115653_2.png) [@ItamarCohen](https://forum.ionicframework.com/u/ItamarCohen)\
**Post date:** [January 14, 2015, 5:43pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/5 "2015-01-14T17:43:46Z")

</div>

please provide a codepan with your code .

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 14, 2015, 6:10pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/6 "2015-01-14T18:10:48Z")

</div>

I’ve forked it and modified to be like mine:

See the Pen [Tabs And Navigation: Nightly](http://codepen.io/ScottN/pen/azJyoW/) by Scott Nelson ([@ScottN](http://codepen.io/ScottN)) on [CodePen](http://codepen.io).

---

<div class="post-metadata">

**Author:** ![ItamarCohen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/itamarcohen/32/115653_2.png) [@ItamarCohen](https://forum.ionicframework.com/u/ItamarCohen)\
**Post date:** [January 15, 2015, 10:07am UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/7 "2015-01-15T10:07:42Z")

</div>

hi,  
it a problem with the 3rd nested views with @ ,  
as i now you have to choices,

1. rewrite you state code the each tab gets a new state like you sew in my codepan.

2. set the ionic config max cache to 0 like

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 15, 2015, 3:28pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/8 "2015-01-15T15:28:36Z")

</div>

Thanks for your reply.

I’ve modified the codepen to use individual states for the tab pages, the app runs but now there are no content on any tab pages and still the problem exists that when navigating to the 2nd tab page, it’s rendering the 1st tab page instead and links only work for the 1st.

Can you see an issue still with my code or is it an Ionic issue?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 15, 2015, 6:25pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/9 "2015-01-15T18:25:58Z")

</div>

So the issue is how you your states defined.

> **[Multi-Tabs And Side-Menu: Nightly](https://codepen.io/mhartington/pen/wBJxwp)**
>
> Demo showing side-menu with multiple tab pages. Current issue with this setup, debugging at the moment. Forked from \[Ionic\](http://codepen.io/ionic/)...

Notice how tab1 and tab2 are setup as abstract states and I also update the names of the home,about, and settings states.

So How you had it before was actually the correct out put for what your code was like.  
Since the view that setup each ion-tabs only had nav-views, it didnt really have any content to display, which is why it was blank.

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 17, 2015, 7:24pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/10 "2015-01-17T19:24:42Z")

</div>

That was it. Thank you!

---

<div class="post-metadata">

**Author:** ![ScottN](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@ScottN](https://forum.ionicframework.com/u/ScottN)\
**Post date:** [January 17, 2015, 7:46pm UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/11 "2015-01-17T19:46:22Z")

</div>

I’m having another little quirk. Is it ok if I continue on this thread for others to follow in the future?

I’ve forked the codepen you did and modified it. Take a look at the link below.

1. I’ve added a “Details” state
2. I’ve created a button on Welcome page that navigates to this state
3. When you click it, it navigates fine and introduces a “back” button to Welcome on the top
4. Click Tabs and then click “Details”
5. The navigation to “Details” happens but no “back” button is at top

Any ideas? Here is codepen:

See the Pen [Multi-Tabs And Side-Menu: Nightly](http://codepen.io/ScottN/pen/GgmRJW/) by Scott Nelson ([@ScottN](http://codepen.io/ScottN)) on [CodePen](http://codepen.io).

---

<div class="post-metadata">

**Author:** ![ThomasDalla](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/thomasdalla/32/65709_2.png) [@ThomasDalla](https://forum.ionicframework.com/u/ThomasDalla)\
**Post date:** [February 21, 2015, 8:17am UTC](https://forum.ionicframework.com/t/multiple-tab-views-issue/15617/12 "2015-02-21T08:17:47Z")

</div>

I had a similar problem and it took me a while to figure it out so sharing in case it happens to someone else.

I defined by mistake the `abstract: true` parameter inside the menuContent, meaning:

```
.state('app.tabs1', {
  url: "/tabs1",
  views: {
    'menuContent': {
      abstract: true,
      templateUrl: "templates/tabs1.html",
      controller: 'Tabs1',
    }
  }
})

```

Instead of (correct below):

```
.state('app.tabs1', {
  url: "/tabs1",
  abstract: true,
  views: {
    'menuContent': {
      templateUrl: "templates/tabs1.html",
      controller: 'Tabs1',
    }
  }
})

```

The wrong code was actually working fine with one set of tabs only, but not when there are multiple menus with tabs (like in this example), only the first set of tabs opened would display.
