MdMenu callback close

Let's say I have an application that can open a menu, for example, through $mdOpenMenu($event) .

My app needs to set a callback to get notified when a menu opens or closes.

How can i achieve this? I have read the official documentation and I cannot find it.

I was looking for something like md-on-remove (used on mdChips ), but for mdMenu it is not implemented ( issue ).

+6
source share
2 answers

$scope.$on("$mdMenuClose", function() { console.log("menu closing") });

+8
source

This works for me:

 ng-click="$mdOpenMenu(); AppCtrl.closeMdMenu();" 

Appctrl

 vm.closeMdMenu = function() { $mdMenu.hide(); }; 
0
source

All Articles