# Is there a way to clear out the nav-router history and prevent a back button?

**URL:** <https://forum.ionicframework.com/t/is-there-a-way-to-clear-out-the-nav-router-history-and-prevent-a-back-button/356>\
**Category:** ionic-v1\
**Created:** [December 28, 2013, 8:17am UTC](https://forum.ionicframework.com/t/is-there-a-way-to-clear-out-the-nav-router-history-and-prevent-a-back-button/356 "2013-12-28T08:17:37Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Calendee](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/calendee/32/13656_2.png) [@Calendee](https://forum.ionicframework.com/u/Calendee)\
**Post date:** [April 4, 2014, 12:55pm UTC](https://forum.ionicframework.com/t/is-there-a-way-to-clear-out-the-nav-router-history-and-prevent-a-back-button/356/7 "2014-04-04T12:55:04Z")

</div>

FYI : You can do this in Js now or with the `nav-clear` directive.

> [@Sign in, then SideMenu](http://forum.ionicframework.com/t/sign-in-then-sidemenu/2586/3):
>
> Theoretically, the new nav-clear directive should do this for you. However, it doesn’t work if you have ng-click defined. So, I took the logic from the directive and put it in your controller. I’ve opened issue # 1047 for this : [https://github.com/driftyco/ionic/issues/1047](https://github.com/driftyco/ionic/issues/1047)

---

_[View the full topic](https://forum.ionicframework.com/t/is-there-a-way-to-clear-out-the-nav-router-history-and-prevent-a-back-button/356)._
