# Ui-router, working with abstract tabs and button

**URL:** <https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267>\
**Category:** ionic-v1\
**Created:** [March 17, 2015, 7:48pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267 "2015-03-17T19:48:34Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![terryoleary](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@terryoleary](https://forum.ionicframework.com/u/terryoleary)\
**Post date:** [March 17, 2015, 9:15pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/21 "2015-03-17T21:15:07Z")

</div>

ah yes! it works! I just need to do the back button 😄

Thank you!!!

---

<div class="post-metadata">

**Author:** ![pjusto](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@pjusto](https://forum.ionicframework.com/u/pjusto)\
**Post date:** [March 19, 2015, 9:32am UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/22 "2015-03-19T09:32:28Z")

</div>

@yurinondual I have a very similar structure like:

```
.state('tab', {
  url: "/tab",
  abstract: true,
  templateUrl: "templates/tabs.html"
  })

  .state('tab.more', {
    url: '/more',
    views: {
      'tab-more': {
        templateUrl: 'templates/tab-more.html',
        controller: 'moreCtrl'
      }
    }
  })

  .state('tab.profile', {
    url: '/profile',
    views: {
      'tab-profile': {
        templateUrl: 'templates/profile.html',
        controller: 'profileCtrl'
      }
    }
  })

```

and

```
<ion-tabs class="tabs-dark" >
    <ion-tab icon="ion-navicon-round" ui-sref="tab.more">
       <ion-nav-view name="tab-more"></ion-nav-view>
    </ion-tab>
    <ion-tab icon="ion-navicon-round" ui-sref="tab.profile">
       <ion-nav-view name="tab-profile"></ion-nav-view>
    </ion-tab>
  </ion-tabs>

```

when I navigate from other page to nested view ‘tab-profile’ I have NO backbutton. It is because its a child view?

I’ve tried remove abstract from ‘tab’ but with no success.

I’ve already saw some talking about this by @mhartington

What should I do?

Thank you 😉

---

<div class="post-metadata">

**Author:** ![terryoleary](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@terryoleary](https://forum.ionicframework.com/u/terryoleary)\
**Post date:** [March 19, 2015, 9:46am UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/23 "2015-03-19T09:46:54Z")

</div>

I added the back button to the view in question and that worked

```
<ion-nav-bar>
  <ion-nav-back-button class="button-clear">
    <i class="ion-arrow-left-c"></i> Back
  </ion-nav-back-button>
</ion-nav-bar>
```

---

<div class="post-metadata">

**Author:** ![pjusto](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@pjusto](https://forum.ionicframework.com/u/pjusto)\
**Post date:** [March 19, 2015, 10:13am UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/24 "2015-03-19T10:13:52Z")

</div>

that didn’t work 😔

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [March 19, 2015, 1:30pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/25 "2015-03-19T13:30:36Z")

</div>

where is the codePen for this? That might make it a ot easier for you to get some help and it shouldn’t take that long to put it together?

---

<div class="post-metadata">

**Author:** ![pjusto](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@pjusto](https://forum.ionicframework.com/u/pjusto)\
**Post date:** [March 19, 2015, 6:18pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/26 "2015-03-19T18:18:31Z")

</div>

Ok, I’ve created a simple codePen.  
When navigating from HOME to OTHER-PAGE animation and back-button appears, but when navigating from OTHER-PAGE to TABS the animation and back-button is lost.

> **[Tabs And Navigation: Nightly](https://codepen.io/anon/pen/pvqNrm)**
>
> Demo showing how each tab has its own history stack. Navigating between each tab remembers the correct back and forward views that were visited. Forke...

---

<div class="post-metadata">

**Author:** ![pjusto](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@pjusto](https://forum.ionicframework.com/u/pjusto)\
**Post date:** [March 24, 2015, 12:35pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/27 "2015-03-24T12:35:09Z")

</div>

@aaronksaunders here’s the codepen

---

<div class="post-metadata">

**Author:** ![yurinondual](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/yurinondual/32/92490_2.png) [@yurinondual](https://forum.ionicframework.com/u/yurinondual)\
**Post date:** [March 24, 2015, 5:29pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/28 "2015-03-24T17:29:48Z")

</div>

This is expected behaviour. Ionic clears state history when navigating between tabs. SO each tab has it’s own history. But you can implement your own back button that will go to your desired route

---

<div class="post-metadata">

**Author:** ![pjusto](https://avatars.discourse-cdn.com/v4/letter/p/db5fbb/32.png) [@pjusto](https://forum.ionicframework.com/u/pjusto)\
**Post date:** [March 24, 2015, 5:48pm UTC](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267/29 "2015-03-24T17:48:33Z")

</div>

@yurinondual thank you for your reply.  
I know that ‘outter’ history is cleared when navigating between tabs.  
This is the current behaviour but not the expected one, when navigating to a view with tabs we should be able to go back to previous state (I’m not talking about between this view tabs).

Also, I dont want to hardcode button back behaviour. Ionic Navigation should handle that.

Ionic is great and in my opinion this is the most important bug that has not yet been fixed.

There is an opened issue in github driftyco/ionic

> <https://github.com/ionic-team/ionic/issues/2997>

[Previous page](https://forum.ionicframework.com/t/ui-router-working-with-abstract-tabs-and-button/19267.md?page=1)
