ionic-team / ionic-ion-drawer

A side menu drawer for Ionic apps
51 stars 84 forks source link

Nav button click to show drawer not working #25

Open nabinkumarn opened 8 years ago

nabinkumarn commented 8 years ago

openDrawer() and closeDrawer() both function does not work. Dragging to open and close drawer works but clicking on item does not close drawer. I am using ionic 1.2.4. has anyone the solution. Documentation has used ion-pane in side menu but i am using ion-side-menu-content. Can anyone give code in details.

m-vdv commented 8 years ago

I was able to fix this by adding this directive to the ionic.contrib.drawer.js file

.directive('menuAndDrawerToggle', ['$rootScope', '$ionicGesture', function($rootScope, $ionicGesture) {
  return {
    controller: '',
    link: function($scope, $element, $attr) {
      $element.bind('click', function(){
          $rootScope.toggleDrawerRoot();
      });
    }
  };
}]);