I just came across this question and noticed that the link published by S. Klechkovsky has a workaround made by christrude. This is not ideal (as other users have pointed out), but at least it works. You can also post it here.
$mdMenu
hide
, .
$scope.closeOthers = function() {
$mdMenu.hide(null, { closeAll: true });
}
HTML
<button ng-click="closeOthers();$mdOpenMenu()">File</button>
Codepen. , .
. , Github ( ), - .
;) frankenstein promises , .
<button ng-click="closeOthers().then($mdOpenMenu);">File</button>
var lock = false;
$scope.closeOthers = function() {
if(lock) {
return;
}
var defer = $q.defer()
lock = true;
$mdMenu.hide(null, { closeAll: true }).then(function() {
lock = false;
defer.resolve();
});
return defer.promise;
}