Last active
August 29, 2015 14:08
-
-
Save mlynch/e2d0aa224d21a61079ab to your computer and use it in GitHub Desktop.
Menu and Drawer toggle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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