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

Dynamic Nested Menu from JSON upto 4 levels #263

Open
Ameya1991 opened this issue Nov 21, 2018 · 0 comments
Open

Dynamic Nested Menu from JSON upto 4 levels #263

Ameya1991 opened this issue Nov 21, 2018 · 0 comments

Comments

@Ameya1991
Copy link

am having issues working with the nested-menu and nested classes while trying to generate dynamic menu using ngFor & ngIf

        <span *ngFor="let item of navItems">
            <span *ngIf="item.children && item.children.length > 0">
                <div style="background-color:darkcyan">{{item.displayName}}</div>
                <app-menu-item #menu [items]="item.children"></app-menu-item>
            </span>
            <span *ngIf="!item.children || item.children.length === 0">
                <div style="background-color:crimson">{{item.displayName}}</div>
            </span>
        </span>
```
{{item.displayName}}
{{item.displayName}}
``` Model Class ``` export interface NavItems { displayName: string; disabled?: boolean; iconName: string; route?: string; children?: NavItems[]; } ```
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