isaacplmann / ngx-contextmenu

An Angular component to show a context menu on an arbitrary component
MIT License
248 stars 91 forks source link

create a submenu from dynamic context menu #175

Open LolBruflex opened 5 years ago

LolBruflex commented 5 years ago

hello, can i create a submenu from a dynamic context menu. below an example of the code, thanks

TS public contextMenuActions = [ { html: (item) => 'Open', click: (item) => alert (item.name), enabled: (item) => true, visible: (item) => true, subMenu: 'subMenuColor' },
]; }

HTML

<context-menu #fileMenu> <ng-template contextMenuItem *ngFor="let action of contextMenuActions" [visible]="action.visible" [enabled]="action.enabled" [divider]="action.divider" (execute)="action.click(action.item)" [subMenu]="action.subMenu">

{{ action.html(action.item) }}
</ng-template>

<context-menu #subMenuColor>

tarangrathod commented 2 years ago

is there any alternative to this