Use right side menu only in a certain view

Hello,

we’ve got an application that uses a left side menu and it’s been working fine. Now I need to show a right side menu only in a certain view.

Since I only want the right side menu in that view and I wanted to fill that menu using my controller’s scope, I tried to just add the menu in the template of the view. I can open the menu fine using $ionicSideMenuDelegate or dragging it, but then the clicks on the side menu aren’t handled. I click the menu and nothing happens.

So our app’s layout ends up being something like this:

View A (defines side menu left):

<ion-side-menus enable-menu-with-back-views="false">
    <ion-side-menu-content>
        ...
        <ion-nav-view name="site"></ion-nav-view>
    </ion-side-menu-content>

    <ion-side-menu side="left">
        ...
    </ion-side-menu>
</ion-side-menus>

View B (loaded in the ion-nav-view name=“site”):

<ion-view>
    <ion-nav-title>Title</ion-nav-title>
    <ion-nav-buttons side="secondary">
        <button class="button button-icon ion-navicon" ng-click="showRightMenu()"></button>
    </ion-nav-buttons>
    <ion-side-menus enable-menu-with-back-views="true">
        <ion-side-menu-content>
            <ion-content>
                ...
            </ion-content>
        </ion-side-menu-content>

        <ion-side-menu side="right">
            <ion-content>
                ...
            </ion-content>
        </ion-side-menu>
    </ion-side-menus>
</ion-view>

Like I said, I’m able to open and see the right side menu, but the clicks in the menu are ignored.

I guess an alternative is to define the right side menu for the whole app (view A) and then show it only in the view I want. The thing is, how do I fill the right menu with items from view B scope? Should I send the data using events or is there a better way to do so?

Thank you,
Dani

1 Like