Open Closed

Angular:How to build all menus from the database #224


User avatar
0
BennieMok created

Hi, I want to build all menus from the table of the database instead of from the code.Because my customer maybe add new menu from the system.Any ideas?Thanks.


5 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    The current design of the menu does not consider persistence to the database, you need to do some work for this.

    1. You need to create an entity that is compatible with ApplicationMenu.

    2. Create a service that persists all menus to the database when the application is initialized(If the menu is not in the database table)

    3. Custom DatabaseMenuManager to replace MenuManager and get the menu from the database(should be filtered based on the current user).

  • User Avatar
    0
    BennieMok created

    Hi, I used angular ui as a front end.So I want to know how to add new menu in front end.Can you give me an example?Thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    you can create a new application service to get your menu items and create your own main menu in Angular.

    added @mehmet to the conversation. @mehmet can you point out where Bennie can build the Angular main menu. he wants to create the main menu from database (host)

  • User Avatar
    0
    Mehmet created

    Hi @BennieMok

    See the Modifying the Menu document.. This will help you.

  • User Avatar
    0
    BennieMok created

    Hello, Ok , I try to do this . But I wish you consider to add a new feature of this. It's very useful for us . Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19