Menu
When running a fresh expanded Angular project, you'll notice that the sidebar contains all items grouped by FeatureModule. If you want a custom menu structure, you have to add it in the menu.service.ts. This service contains custom anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion. to add menu entries.
MenuEntry.ts
export type MenuEntry = MenuItem | MenuGroup;
export interface MenuGroup {
groupTitle: string;
ordering?: number;
items: MenuItem[];
}
export type MenuItem = {
identifier?: string;
title: string;
link?: string | unknown[];
icon?: string;
openInNewTab?: boolean;
childItems?: MenuEntry[];
ordering?: number;
badgeCount?: number;
}
A menu entry requires a title, but other attributes are optional. Entries of title will be translated using the translation service.
Example
{
title: 'space.name',
childItems: [
{
title: 'space.data_elements.star_ship.name',
link: '/space/star-ship',
icon: 'spaceship'
}
]
}