md-menu 'is-open' state attribute
It would be great to have a reference to the state of an md-menu. This could be accomplished through an md-is-open attribute similar to that of md-sidenav. It would provide something like this:
<md-menu md-is-open="menuIsOpen">
<md-button ng-class=" { 'some-class': menuIsOpen }">
Button styled differently when menu is open
</md-button>
...
</md-menu>
@SpenceDiNicolantonio you can subscribe for $mdMenuOpen event and $mdMenuClose as a temporary solution for now.
$scope.$on('$mdMenuClose', function(ev, element) {
});
$scope.$on('$mdMenuOpen', function(ev, element) {
});
@SpenceDiNicolantonio
In your template you can use $mdMenuIsOpen which will be set to true if open / undefined if closed
You can also tap into the upper level class that is added
._md-open
This issue is closed as part of our deprecation effort. For details, see our post Spring Cleaning 2016.
@SpenceDiNicolantonio you can subscribe for $mdMenuOpen event and $mdMenuClose as a temporary solution for now.
$scope.$on('$mdMenuClose', function(ev, element) { }); $scope.$on('$mdMenuOpen', function(ev, element) { });
Thanks. That helped