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

Unable to render nested submenu #240

Open
lazaro3487 opened this issue Sep 27, 2021 · 0 comments
Open

Unable to render nested submenu #240

lazaro3487 opened this issue Sep 27, 2021 · 0 comments

Comments

@lazaro3487
Copy link

Hello.

I am trying to render sub menu by following this approach however it is not working:

<context-menu>
    <ng-container *ngFor="let action of menuEntries">
        <ng-template
            contextMenuItem
            let-item
            [visible]="action.visible"
            [enabled]="action.enabled"
            [divider]="action.divider"
            [subMenu]="subMenu"
            (execute)="action.click($event.item)">
            <div [ngClass]="action.icon"> {{ action.value }}</div>
        </ng-template>

        <context-menu #subMenu>
            <ng-template
                *ngFor="let childAction of action?.children"
                contextMenuItem
                let-item
                [visible]="childAction.visible"
                [enabled]="childAction.enabled"
                [divider]="childAction.divider"
                (execute)="childAction.click($event.item)">
                <div [ngClass]="action.icon"> {{ action.value }}</div>
            </ng-template>
        </context-menu>
    </ng-container>
</context-menu>

It seems like a dynamic nested sub menu does not work.

Do you have any idea on how to accomplish it or maybe it is a bug of the library?

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