If I have more than one menu element in a page, how will I open a particular menu based on the context or how can I select a menu element using ViewChild by specifying the name?
@crisbeto What could be done for this kind of scenario?
I couldn't got your question, what would you like to achieve?
https://plnkr.co/edit/gbpvuno5thiUzlYNIcb3?p=preview
In the example, how will I open the second menu when I click on the "open second menu button"?.
So you can do something like that:
https://plnkr.co/edit/ScrbSJQWkAdjaAI7EKQU?p=preview
The better approach would be using a query selector
@ViewChild('trial') trigger: MdMenuTrigger;
But i'm getting the mdButton directive instead of the trigger, i will check what we can do with that.
Thanks @EladBezalel . Will wait for the update.
I got the same result when I tried with the first plnkr sample.
At times we cannot rely on the index and need to find out the controls by name.
Take a look here: https://plnkr.co/edit/AmWcuUNw1YaZeluLq0aJ?p=preview
Perfect. @EladBezalel Thanks for the help.
How do we assign mdMenuTriggerFor dynamically ?
[mdMenuTriggerFor]="link.menuName"
@shijithkm
You can see here https://stackblitz.com/edit/dynamic-nested-menus?file=app%2Fapp.component.ts
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._