Is there a way to know if side-menu expose aside is open

I want to perform different actions if the side menu is expose aside (tablet) or not (smarphone).
Indeed I have a list of items; when I’m on smartphone the click on an item change the page, but when I’m on tablet I just want to display informations on aside menu.

Is there a programmatically way to know if the aside menu is open ?

Using the $ionicSideMenuDelegate you can get if the sidemenu is open or not$ionicSideMenuDelegate/

I know but the problem is the function $ionicSideMenuDelegate.$getByHandle(‘my-handle’).isOpen() always respond false even if the side menu is open with expose aside directive…

Isn’t using isOpen() easier?

What do you mean by isOpen() easier ?
I already use this function

Ow sorry, I didn’t see that.

Do you have 1 or 2 sidemenus in your app?
If 1: try it without $getByHandle

I have 2 sidemenus in the app.
One for the navigation the other for list details.

Well, I’m out of ideas.
Hopefully somebody else can help you with that.
Calling somebody of the Ionic team might help. This could possibly be a bug

Ok, thanks for all :blush:

You could pass $ to a function that determines which action to take:

<a ng-click="clickedItem($" class="item" menu-close>Check-in</a>

See this codepen

I’m not sure if it is a bug or not, but I feel like using $ionicSideMenuDelegate.isOpen() should return true when exposeAside is active. You could submit an issue for it and the Ionic team can determine if it is.

Hey brandyshea,

Your solution with $ works like a charm :smiley: !

I’m agree with you, the $ionicSideMenuDelegate.isOpen() shoud return true when expose aside is active. But maybe Ionic want to differenciate an open state and expose aside state… don’t know.

Thank’s a lot

1 Like