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

Menu show empty when remove data from it and its children #77

Closed
TrungVuDang opened this issue Jul 13, 2016 · 2 comments
Closed

Menu show empty when remove data from it and its children #77

TrungVuDang opened this issue Jul 13, 2016 · 2 comments
Milestone

Comments

@TrungVuDang
Copy link

  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
  • Do you want to request a feature or report a bug?
    This is bug
  • What is the current behavior?
    For a menu, which I don't want to show on left menu, I did remove all "data" attribute from it and its children, but it still now the empty menu item.
  • What is the expected behavior?
    It should not show any menu item which and its children don't have "data" attribute
  • What is the motivation / use case for changing the behavior?
    I fixed it myself by add some line of code into baMenu.service.ts method _skipEmpty at line 36
 if (item.children && item.children.length > 0) {
          menuItem = this._skipEmpty(item.children);
          if (menuItem.length == 0){
            menuItem = null;
          }
        }
  • Please tell us about your environment:
  • Angular version: 2.0.0-rc.4
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
@nnixaa
Copy link
Collaborator

nnixaa commented Jul 13, 2016

Hi @TrungVuAnt, thanks for reporting, could you provide a PR for this fix? Thanks.

@nnixaa nnixaa added this to the v0.5.0 milestone Jul 14, 2016
@TrungVuDang
Copy link
Author

Hi @nnixaa, I intend to fix it, but I found if fix as I suggested, it will cause another issue: the page title and breadcrumb will show empty. That's because the left menu, the page title and the breadcrumb just show info from the "route->data->menu", I think, it should be separated, the menu, the page title, besides that, it also needs a way to show/hide menu depend on permissions of user.

@nnixaa nnixaa modified the milestones: v0.6.0, v0.5.0 Aug 30, 2016
@nnixaa nnixaa closed this as completed Dec 1, 2016
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

3 participants