Skip to content

Extending main menu

Adding new items to application's menu

.run(
  ['$rootScope', 'platformWebApp.mainMenuService', '$state', function ($rootScope, mainMenuService, $state) {
    //Register module in main menu
    var menuItem = {
      path: 'browse/unmanaged module',
      icon: 'fa fa-cube',
      title: 'My cool module',
      priority: 110,
      state: function () { $state.go('workspace.unmanagedModuleTemplate'); },
      permission: 'UnmanagedModulePermission'
    };
    mainMenuService.addMenuItem(menuItem);
  }]);

Mind the priority property as it defines the menu position relative to the other menu options; smaller number means higher priority and such menu item is displayed first.


Last update: September 4, 2020