Disable Side Menu from Template or associated Controller?

Is there an easy way to enable or disable the side-menu based on what template is loaded in the view or does this have to be completed through a function?

If it does need to be manipulated within the controller, what would that code look like?

Is there any sort of tag like the has-header in ion-content or hide-back-button in ion-view that can be added to disable the side-menu?

See these previous topics:

You very well may want to setup your views so that you have a main template file that will be used for views that need a menu and a completely other main template file that would be used for views that don’t need a side menu.

Here is a good blog on the topic:

1 Like

Thanks, I saw those other posts in my search prior to posting, but they didn’t really seem. That blog, on the other hand, is written about the exact same issue I’m facing.

For immediate term I’m just disabling drag. When I have time I’ll dig into the router to gain better understanding and solve it the right way like in that blog post.

Was hoping there was an easier way, maybe a directive that looks for dragDisabled in the ion-view tag which disables dragging to the side menu. I could see it being an issue for highlighting text and other applications that could mistakenly trigger the side menu.

Thank you.

The drag-content="false" really does the trick and the no-drag-right directive in my Plunker works too:

Maybe I’m looking at something wrong, but that plnkr doesn’t seem to be working.
Did one of the recent ionic updates break it?

That Plunker is running 0.9.22. It works fine. On the “Home” page, you can drag open the menu. On the “About” page you cannot.

Here is a 0.9.26 version: http://plnkr.co/edit/Zpg3fgMuXnqLWDhj5SMj

1 Like

I’ve resolved what I’m doing in my app, so no further assistance needed on this, but the drag-disabled still isn’t working for me on either of the plunkers you posted.

I created a quick youtube of my interaction with the latest plunker in case it might help you diagnose any problems with the framework. I’m not comfortable making the link public, so shoot me an email at info (at) origindev (dot) com and I’ll send you the link.

Thanks for all your help.

hi… today i was just working on this: a secondary (disabled by default) sidemenu. to be activated and show only on subpage 8i use it to show the “chapters” of the book to be read.

you can check my code here: https://github.com/krur/Silo_app (the BookController and relative views)

Thanks for the input. I just watched your YouTube post and saw you were using Firefox. You are right - in Firefox the no-drag-right and drag-content="false" doesn’t work.

Being that Ionic doesn’t really support desktop, I guess it’s not “really” a bug. Also keep in mind that I made that little demo; so, it’s far from perfect and certainly not official.


Despite that, it’s an interesting issue. It makes me wonder what would happen on a FireFox OS device. The devs have one; so, I will ping them to see what’s up.

1 Like

UPDATE : The flaw is completely in my no-drag-right directive. It didn’t work in Firefox. However, the drag-content="false" works perfectly.

Here’s a sample : http://plnkr.co/edit/WZFRfSfV2zVt1igpC3jY?p=preview

This doesn’t seem to be working in my app.
Does this attribute still work?