# Disable side menu conditionally

**URL:** <https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565>\
**Category:** uncategorized\
**Created:** [May 21, 2014, 2:28am UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565 "2014-05-21T02:28:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![boopage](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@boopage](https://forum.ionicframework.com/u/boopage)\
**Post date:** [May 21, 2014, 2:28am UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/1 "2014-05-21T02:28:31Z")

</div>

I want to show side menu only when user logged in, is there a way I can conditionally enable or disable the slide menu?  
I am doing this “”, this works when user not logged in and after logged, But when user logged out the menu still slide in (which should not be), and the menu content id blank…

Any idea?

---

<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:** [May 21, 2014, 2:52am UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/2 "2014-05-21T02:52:11Z")

</div>

Use the `drag-content` attribute.

[http://ionicframework.com/docs/nightly/api/directive/ionSideMenuContent/](http://ionicframework.com/docs/nightly/api/directive/ionSideMenuContent/)

In a controller, you can change the value of the boolean.

```auto
<ion-side-menu-content
  drag-content="allowSideMenu">
</ion-side-menu-content>

```

```auto
$scope.allowSideMenu = false;

```

VERY old sample : [http://plnkr.co/edit/WZFRfSfV2zVt1igpC3jY?p=preview](http://plnkr.co/edit/WZFRfSfV2zVt1igpC3jY?p=preview)

---

<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:** [May 21, 2014, 2:55am UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/3 "2014-05-21T02:55:49Z")

</div>

References:

- [Should drag-content="false" be available on view?](http://forum.ionicframework.com/t/should-drag-content-false-be-available-on-view/1201)
- [Stop Side Menu Drag to Open](http://forum.ionicframework.com/t/stop-side-menu-drag-to-open/1011/16)
- [Unable to turn on and off Sidemenu functionality](http://forum.ionicframework.com/t/unable-to-turn-on-and-off-sidemenu-functionality/1910/2)

---

<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:** [May 28, 2014, 1:14pm UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/4 "2014-05-28T13:14:18Z")

</div>

FYI : Now see `is-enabled`

> **[Optional (right) sidebar](http://forum.ionicframework.com/t/optional-right-sidebar/4859/3?u=calendee)**
>
> UPDATE : I just discovered is-enabled. So, see the updated CodePen. It disables the right hand side menu just fine. Codepen Sample : http://codepen.io/calendee/pen/mjtJL http://ionicframework.com/docs/api/directive/ionSideMenu/

Sample : [http://codepen.io/calendee/pen/mjtJL](http://codepen.io/calendee/pen/mjtJL)

---

<div class="post-metadata">

**Author:** ![degroundshaker](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/degroundshaker/32/70984_2.png) [@degroundshaker](https://forum.ionicframework.com/u/degroundshaker)\
**Post date:** [December 2, 2014, 8:58pm UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/5 "2014-12-02T20:58:05Z")

</div>

> [@Calendee](#):
>
> $scope.allowSideMenu = false;

But this disabled the sidemenu swipe gesture on all other pages. Only way I am able to access the sidemenu is by toggling.

---

<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:** [December 3, 2014, 11:00am UTC](https://forum.ionicframework.com/t/disable-side-menu-conditionally/4565/6 "2014-12-03T11:00:55Z")

</div>

That was the intent. Using this gives you the ability to decide what pages the side menu works on.

FYI : Lots of changes to side menus in the nightlies and the upcoming Beta 14. Might want to check those out as well.
