# Any way to -not- reset history stack on menu-close?

**URL:** <https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340>\
**Category:** ionic-v1\
**Created:** [January 25, 2015, 5:18pm UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340 "2015-01-25T17:18:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattblac](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mattblac](https://forum.ionicframework.com/u/mattblac)\
**Post date:** [January 25, 2015, 5:18pm UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340/1 "2015-01-25T17:18:21Z")

</div>

Is there a way to create links in the side menu that act as sub-pages to the root page, instead of each link becoming root pages themselves? I would like each of my pages to have a back button as needed, and no pages being viewed from the side-menu are getting one.

I’m aware that the menu-close directive causes the history stack to be reset due to a UI best practice guideline, and it seems I would like to go directly against that. I’ve tried using menu-toggle in place of menu-close, but that causes a weird double transition effect.

Thanks!

---

<div class="post-metadata">

**Author:** ![brandyshea](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brandyshea/32/148286_2.png) [@brandyshea](https://forum.ionicframework.com/u/brandyshea)\
**Post date:** [January 26, 2015, 4:03pm UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340/2 "2015-01-26T16:03:11Z")

</div>

You can put a ng-click on the menu item and use toggleLeft (or right depending on your sidemenu) to close it:

HTML:

```
<ion-item ng-click="closeMenu()" ui-sref="page2">Page 2</ion-item>

```

JS:

```
$scope.closeMenu = function() {
    $ionicSideMenuDelegate.toggleLeft();
}
```

---

<div class="post-metadata">

**Author:** ![mattblac](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mattblac](https://forum.ionicframework.com/u/mattblac)\
**Post date:** [January 29, 2015, 2:41am UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340/3 "2015-01-29T02:41:45Z")

</div>

Thanks Brandy. That comes close to what I want to achieve, but not quite. There’s still an issue of the page transitioning while the menu is closing, which looks awful.

What I need is to be able to use nav-clear to disable transitions on specific links, but that seems to reset the history stack in the same way menu-close does.

---

<div class="post-metadata">

**Author:** ![brandyshea](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/brandyshea/32/148286_2.png) [@brandyshea](https://forum.ionicframework.com/u/brandyshea)\
**Post date:** [January 29, 2015, 3:25am UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340/4 "2015-01-29T03:25:55Z")

</div>

Hmm you can use $ionicHistory before navigating. This is the same thing menu-close does minus the history reset.

```
$ionicHistory.nextViewOptions({
        disableAnimate: true
});
```

---

<div class="post-metadata">

**Author:** ![mattblac](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mattblac](https://forum.ionicframework.com/u/mattblac)\
**Post date:** [January 30, 2015, 2:11am UTC](https://forum.ionicframework.com/t/any-way-to-not-reset-history-stack-on-menu-close/16340/5 "2015-01-30T02:11:15Z")

</div>

That worked perfectly, thank you!
