Having trouble trying to close side-menu


#1

I’m having trouble trying to close the side menu when you click a link in the side-menu. I currently have a side-menu with a nested nav bar/view in the main content.

The side menu opens and closes when I swipe or click on my menu icon but when I try to click a link and call toggle, nothing happens but sometimes jitters a little.

Is there some scoping issue going on because I have a controller for the main content page where I call the first toggle from?

Thanks!
Josh


#2

I fixed it by binding the toggle function to the root scope but this doesn’t seem like the right way to do this.


#3

i just made the side-menu fully working with autoclose: https://github.com/krur/Silo_app


#4

That is a great setup. Would you mind if I copy it to use as a foundation for my app? I really like your organization.


#5

frank… if you’re talking with me: sure! do it as you please! i made it in GitHub just for that! :slight_smile:


#6

@krur great app man!!

I think $ionicSideMenuDelegate.close() function is not available anymore for closing the side menu, at least I get undefined error using beta10, and its removed from docs.

I fixed it using

if($ionicSideMenuDelegate.isOpenLeft()){
    $ionicSideMenuDelegate.toggleLeft();
}