sasi sasi - 2 months ago 29
AngularJS Question

How to enable/disable the left/right side menu ionic

I have both left and right side menus in my page. My app has English/Arabic translation. When in english language the panel should be from left side and for the arabic the panel should be from right side.

So I am planning to have both the menus in my page and enable/disable the left/right panel menu according to the language.

My menu page will look something similar to below:

<!-- Left menu -->
<ion-side-menu side="left" is-enabled={{enableLeftMenu}}>

<!-- Main content, usually <ion-nav-view> -->

<!-- Right menu -->
<ion-side-menu side="right" is-enabled={{!enableLeftMenu}}>


So I am trying to play with

But the problem is when I change the value of
attribute from controller, it is not getting affected in the view.


You'll need to inject $ionicSideMenuDelegate into your controller and then use the toggleLeft() or toggleRight() function on it, depending on which menu you want to toggle.

Hope that helps!