Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically change Menu Items depending on the state the clicked element is in #79

Open
Liafdev opened this issue May 7, 2019 · 0 comments

Comments

@Liafdev
Copy link

Liafdev commented May 7, 2019

I have a use-case where I need to show menu items on right click depending on the number of sub objects in the clicked element.

For example I have a element you can right click that contains 2 Jobs, on Right Click there should be 2 Entries (1 for each job) containing a submenu for available options for that job.

I tried it like this, but unfortunately you can't use the injected data in the same element, but I can't do the ngFor inside the ng-template either because then there will still only be one menu entry.

<sh-context-menu #jobsRcMenu>
<ng-template *ngFor="let menu of data" let-data shContextMenuItem>
<div>
{{menu}}
</div>
</ng-template>
</sh-context-menu>

I also tried putting the shContextMenuItemDirective inside the ng-template, but unfortunately I think an internal ngFor you're using doesn't work anymore.

Is there a way with the current version to do what I'm trying to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant