-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(aria/menu): Menu Trigger data #32782
Copy link
Copy link
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: aria/menufeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: aria/menufeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature Description
Currently aria menu doesn't seem to allow passing context data to the template from the trigger e.g. same trigger data as
cdkMenuTriggerDataNot sure if this feature is in scope, or can be done otherwise better
Use Case
The idea is to share the same menu within a loop, however passing the item in context e.g.
@for (item of collection; track item.id) { <button ngMenuTrigger #origin #trigger="ngMenuTrigger" [menu]="formatMenu()" [menuData]="item">Open Menu</button> } <div ngMenu class="menu" #formatMenu="ngMenu"> <ng-template ngMenuContent let-item="item"> <div ngMenuItem value="Mark as read" (click)="markAsRead(item)"> <span class="icon material-symbols-outlined" translate="no" aria-hidden="true">mark_email_read</span> <span class="label">Mark as read</span> </div> </ng-template> </div>