Coder Social home page Coder Social logo

how to create multi sidebar about ngx-admin HOT 2 CLOSED

akveo avatar akveo commented on May 18, 2024
how to create multi sidebar

from ngx-admin.

Comments (2)

nnixaa avatar nnixaa commented on May 18, 2024 2

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.

from ngx-admin.

nnixaa avatar nnixaa commented on May 18, 2024

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

from ngx-admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.