# MenuSettings

**Kind:** Class

**Source:** `Frontend/src/app/components/shared/app-menu/menu.settings.ts` (line 7)

**Part of:** [Frontend](subsystem-frontend-src-app)

`MenuSettings` manages menu state based on the current URL in the shared application menu. It checks whether a URL matches menu criteria through `CompareUrl()` and performs URL lookup logic through `searchforURL()`.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `CompareUrl` | `CompareUrl(url: string, val: string)` | `boolean` |
| `searchforURL` | `searchforURL(url: string)` | `void` |

## Properties

| Property | Type |
|---|---|
| `root` | `MenuModel[]` |

## Diagram

```mermaid
graph LR
  A[Application Menu] --> B[MenuSettings]
  B --> C[searchforURL]
  C --> D[Current URL]
  B --> E[CompareUrl]
  E --> F[Match Result]
```

## Usage

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

const menuSettings = new MenuSettings();

menuSettings.searchforURL();

const isCurrentMenuUrl = menuSettings.CompareUrl();

if (isCurrentMenuUrl) {
  // Apply the active menu state.
}
```

## AI Coding Instructions

- Keep URL-related menu logic inside `MenuSettings` rather than duplicating it in menu components.
- Call `searchforURL()` before relying on URL lookup state used by `CompareUrl()`.
- Preserve the existing method names and casing: `CompareUrl()` and `searchforURL()`.
- Confirm URL comparisons account for the application routing format before changing matching behavior.

## Relationships

- IMPORTS → `SubscriptionPackagesEnum`
- IMPORTS → `MenuModel`
- IMPORTS → `AppSettings`

## 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)

- `AppMenuComponent` — `Frontend/src/app/components/shared/app-menu/app-menu.component.ts`:1
- `SideMenuComponent` — `Frontend/src/app/components/shared/side-menu/side-menu.component.ts`:1
