Skip to content

Instantly share code, notes, and snippets.

@mlynch
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlynch/e2d0aa224d21a61079ab to your computer and use it in GitHub Desktop.
Save mlynch/e2d0aa224d21a61079ab to your computer and use it in GitHub Desktop.
Menu and Drawer toggle
angular.module('myApp', ['ionic'])
.directive('menuAndDrawerClose', ['$ionicViewService', function($ionicViewService) {
return {
restrict: 'AC',
require: '?^ionSideMenus,?^drawer',
link: function($scope, $element, $attr, ctrls) {
$element.bind('click', function(){
ctrls[0] && ctrls[0].close();
ctrls[1] && ctrls[1].close();
});
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment