
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
angular-router-menus
Advanced tools
Simplify your Angular applications navigation by defining menu entries directly at the route itself. It is fully typed and defined by your requirements, build as many navigation's as you like. It also supports nesting menus so you can build yourself cool dropdowns. All menus are build and injected into several injection tokens, so you can import them anywhere.
pnpm add angular-router-menus
[!TIP] Zero dependencies and no performance bottleneck!
angular-router-menus: This ensures you have all required types globallyangular-router-menus/angular: This patches Angular's Route(r) type with a new entrydeclare type Menus = "main"menus.ts file, this will hold your Menus stack injection tokensmain.ts file import and configure the library as described belowmenus.tsimport { InjectionToken, type WritableSignal, signal } from "@angular/core";
import type { MenuItems, MenuStacks } from "angular-router-menus";
export const MENU_STACK = new InjectionToken<WritableSignal<MenuItems>>("MENU_STACK", {
providedIn: "root",
factory: () => signal([]),
});
export const menus: MenuStacks = {
main: MENU_STACK,
};
main.tsimport { bootstrapApplication } from "@angular/platform-browser";
import { provideRouter, withComponentInputBinding } from "@angular/router";
import { provideRouterMenus } from "angular-router-menus";
import { AppComponent } from "./app/app.component";
import { menus } from "./menus";
import { routes } from "./routes";
void bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes, withComponentInputBinding()),
provideRouterMenus(routes, menus, {
defaultMenu: "main", // 👋🏻
}),
],
}).catch((error) => {
console.error(error);
});
import { ChangeDetectionStrategy, Component, inject } from "@angular/core";
import { RouterLink, RouterLinkActive, RouterOutlet } from "@angular/router";
import { MENU_STACK } from "../menus";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrl: "./app.component.scss",
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [RouterOutlet, RouterLink, RouterLinkActive],
})
export class AppComponent {
readonly menu = inject(MENU_STACK); // 👋🏻
}
<ul>
@for (item of menu(); track item.href) {
<li>
<a [routerLink]="item.href" routerLinkActive="active">{{ item.label }}</a>
</li>
}
</ul>
For details on menu items configuration, please take a look at the interfaces and its documentation here: projects/angular-router-menus/src/lib/menu.ts
| Property | Description |
|---|---|
defaultMenu | If not defined via in this is the default menu. |
For an example go to projects/app and run it :)
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.