Dave
Dave

Reputation: 1277

md-menu won't open with ng-click

I'm trying to create a md-menu inside of a md-toolbar and have it open on click. My code for the button that would open the dropdown menu is below:

<md-button aria-label="Open menu" class="md-icon-button" ng-show="(data.isAdmin || getUIActions('context').length > 0) && options.omitHeaderOptions != 'true'" ng-click="$mdMenu.open()">
    <md-icon md-menu-origin id="adminMenu">menu</md-icon>
</md-button>

I have two questions --

1) In a previous iteration of this code, I had ng-if on my md-button. With ng-if, the dropdown menu was always open and could not be closed. When I switched to ng-show or took out the condition completely, the menu is gone. Is there a reason why ng-show works and ng-if doesn't?

2) I copied the code for ng-click directly from the angular material documentation, but cannot seem to get the click to open up the menu. Am I missing something?

Upvotes: 0

Views: 233

Answers (1)

Dave
Dave

Reputation: 1277

I was using v.1.1.0 when I encountered this issue. Once I updated to v.1.1.5, the problem got fixed.

Upvotes: 1

Related Questions