Reputation: 33
Hi i would like to have a mat-menu open to the left.
i got some scratch code in stackblitz, here is the link
the structure should like this Menu -> Item 1 Item 2 Item 3
or the oppposite direction Item 1 Item 2 Item 3 <- Menu
any ideas? thanks
Upvotes: 0
Views: 904
Reputation: 1944
The matMenuTrigger
exposes an openMenu()
function that can be called to open the menu programmatically.
So to achieve the desired effect:
menuOpened
event of the main trigger,openMenu()
on the sub-trigger.The only issue is, that since the sub-trigger will open before the parent has finished animating, it will not position properly. So:
setTimeout
function to delay the opening of the sub-trigger.Upvotes: 0