ngx-contextmenu
ngx-contextmenu copied to clipboard
Allow triggering the context menu before ContextMenuItems have been loaded
It would be nice if the context menu gracefully handled people trying to trigger it before the ContextMenuItems had been found by the ContextMenuComponent.
We could create a Subject that emits the menuItems in the ngAfterContentInit hook of the component and use that in the onMenuEvent method to only trigger the context menu after the menuItems are loaded.
Originally reported by @achyutgp in issue #6.
Yes that's a nice idea. Currently I'm using it like this:
- Retrieve contextMenuActions anyhow, async way maybe.
- Call contextMenuService.show.next.
Would be nice to show a menu with a scroller and than show items.
Though there's one question here. For some reason currently I need to call setTimeout(() => contextMenuService.show.next) otherwise execute actions don't work.