Skip to content

MenuSettings

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.Web/Client/app/components/shared/app-menu/menu.settings.ts (line 19)

Part of: Pams

MenuSettings supports URL-based behavior in the shared application menu. It searches for a URL through searchforURL() and exposes CompareUrl() to report whether the current URL matches the menu settings.

Methods

MethodSignatureReturns
CompareUrlCompareUrl(url: string, val: string)boolean
searchforURLsearchforURL(url: string)void

Properties

PropertyType
rootMenuModel[]

Diagram

mermaid
graph LR
  Menu[App Menu Component] --> Settings[MenuSettings]
  Settings --> Search[searchforURL()]
  Search --> Compare[CompareUrl()]
  Compare --> Match[boolean result]

Usage

ts
import { MenuSettings } from './menu.settings';

declare const menuSettings: MenuSettings;

menuSettings.searchforURL();

if (menuSettings.CompareUrl()) {
  // Handle the menu item that matches the current URL.
}

AI Coding Instructions

  • Call searchforURL() before relying on URL-related menu state when the current route changes.
  • Preserve the existing method casing: CompareUrl() and searchforURL() are distinct API names.
  • Treat the result of CompareUrl() as a boolean condition for menu selection or visibility logic.
  • Keep URL comparison behavior within MenuSettings rather than duplicating matching logic in menu components.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • AppMenuComponentPams/Web/Pams.Web/Client/app/components/shared/app-menu/app-menu.component.ts:1
  • SideMenuComponentPams/Web/Pams.Web/Client/app/components/shared/side-menu/side-menu.component.ts:1

Was this page helpful?

Download as PDF