Disable sidemenu animation for login page


#1

I have an application with sidemenu, based on sidemenu template. In addition the standard screen navigated from menu, I have a login page which is not part of the menu.
I defined this login in app.js:

$urlRouterProvider.otherwise(’/app/login’);

once login is successful I redirect to one of the other screens.

Of course I don’t want that before login users will be able to go to other screens. I was able to hide navigation button by simply commenting ion-nav-buttons, however I can still slide on login page to the right and then I see the sidemenu.
I noticed that ion-pane element created for login page still has “menu-animated”, while the root element of login page itself - ion-view is added lower in elements hierarchy.

My question is how can I disable animation only for this specific page.


Login screen and slide menu
#2

Use drag-content=“false” to restrict the dragging of side menu.


#3

As I understand this property should be added to ion-pane which is defined in menu.html, adding it indeed disable the slide but it does so for all screens.
Is there a way to set it to false statically only for a specific page or do I need to set it dynamically for each page ?


#4

Define variable say ‘$rootScope.slideSideMenu = false’ in your controller. Set it to true once the login is successfull. Bind this variable to the property of drag-content=“slideSideMenu”.


#5

This solution works perfect ! Thanks.


#6

Glad it helped. welcome.


#7

I have a similar problem because on tablets I use the force menu open option. However, on the login page, and a few others I want the menu to go away completely. Anyway of doing this?