{"action":"opened","issue":{"url":"https://api.github.com/repos/angular/material/issues/10723","repository_url":"https://api.github.com/repos/angular/material","labels_url":"https://api.github.com/repos/angular/material/issues/10723/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/10723/comments","events_url":"https://api.github.com/repos/angular/material/issues/10723/events","html_url":"https://github.com/angular/material/issues/10723","id":234346129,"number":10723,"title":"$mdOpenMenu undefined on initial page load till a $mdDialog.show is called ","user":{"login":"Bartaf83","id":12170979,"avatar_url":"https://avatars0.githubusercontent.com/u/12170979?v=3","gravatar_id":"","url":"https://api.github.com/users/Bartaf83","html_url":"https://github.com/Bartaf83","followers_url":"https://api.github.com/users/Bartaf83/followers","following_url":"https://api.github.com/users/Bartaf83/following{/other_user}","gists_url":"https://api.github.com/users/Bartaf83/gists{/gist_id}","starred_url":"https://api.github.com/users/Bartaf83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bartaf83/subscriptions","organizations_url":"https://api.github.com/users/Bartaf83/orgs","repos_url":"https://api.github.com/users/Bartaf83/repos","events_url":"https://api.github.com/users/Bartaf83/events{/privacy}","received_events_url":"https://api.github.com/users/Bartaf83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-07T21:19:23Z","updated_at":"2017-06-07T21:19:23Z","closed_at":null,"body":"I had a md-menu working well since a long time in my app but then it stopped to work so i thought angular material weren't injected on the app controller but that wasn't the cause of this problem as also there is an md-dialog which still working well and i found that once i open the md-dialog, the md-menu start to work and the $mdOpenMenu which is passed as paramter on the md-menu template is no longer undefined.\r\n\r\n\r\nthis is the template where is the md-menu :\r\n```\r\n<md-menu class=\"pp_menu\" ng-controller=\"popupCtrl as basicm\">\r\n    <div class=\"ui-grid-cell-contents\" style=\"text-align: center; vertical-align: middle;\" ng-click=\"grid.appScope.openMenu($mdOpenMenu, $event, row, col)\">{{grid.getCellValue(row, col)}}</div>\r\n    <md-menu-content class=\"pp_menu_cnt\" layout=\"column\">\r\n        <md-menu-item class=\"pp_menu_item\" layout=\"column\" md-autofocus=\"false\" ng-repeat=\"item in basicm.items1\">\r\n            <md-button md-ink-ripple=\"{{item.rippleColor}}\" ng-click=\"grid.appScope.menuItemClick($event, item, row, col )\">\r\n                <div layout=\"row\"  layout-align=\"space-around center\">\r\n                    <svg ng-if=\"item.showLabelsColorOpt\" class=\"coloricon\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\r\n                        <path d=\"M24 24H0V0h24v24z\" fill=\"none\" />\r\n                        <circle id=\"cicircle\" cx=\"12\" cy=\"12\" fill=\"{{item.rippleColor}}\" r=\"8\" />\r\n                    </svg>\r\n                    <p flex>{{item.content}}</p>\r\n                </div>\r\n            </md-button>\r\n        </md-menu-item>\r\n    </md-menu-content>\r\n</md-menu>\r\n```\r\n\r\nthe function to open it : \r\n\r\n```\r\n$scope.openMenu = function($mdOpenMenu, ev, row, col) {            \r\n\r\n// some other code here\r\n            console.log('%c $mdOpenMenu : ' + JSON.stringify($mdOpenMenu), 'background: blue; color: white; display: block;');   \r\n            originatorEv = ev;\r\n            $mdOpenMenu(ev);\r\n        };\r\n```"}}
{"actor":{"display_login":"Bartaf83"}}