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

how to create multi sidebar #19

Closed
tienthanh1993 opened this issue Jun 2, 2016 · 2 comments
Closed

how to create multi sidebar #19

tienthanh1993 opened this issue Jun 2, 2016 · 2 comments

Comments

@tienthanh1993
Copy link

my website have more use type each have different menu. How can i make it with ng2-admin

thanks !

@nnixaa
Copy link
Collaborator

nnixaa commented Jun 3, 2016

Hi @tienthanh1993. It is not possible out of the box at the moment, but with a little work you can easily configure this:

  1. As stated in the documents, menu items are configured in https://github.com/akveo/ng2-admin/blob/master/src/app/app.menu.ts.
  2. You can add some additional parameter, say role into item's object specifying for which role this menu item is available:
{
    title: 'Dashboard',
    component: 'Dashboard',
    icon: 'ion-android-home',
    selected: false,
    expanded: false,
    order: 0,
    role: 'admin' // like this
  },
  1. Then in the https://github.com/akveo/ng2-admin/blob/master/src/app/theme/components/baSidebar/baSidebar.service.ts#L10 you can just filter menu items by current user role.

That's it, let me know if you have any questions.

@nnixaa
Copy link
Collaborator

nnixaa commented Jun 7, 2016

@tienthanh1993 I'm closing the issue now, hopefully, you resolved the issue, if any questions - drop us a line. Thanks!

@nnixaa nnixaa closed this as completed Jun 7, 2016
denStrigo pushed a commit to denStrigo/ngx-admin that referenced this issue Aug 7, 2018
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