Skip to main content
cngx-src documentation

injectMenuItemCore

Functioncommon/interactive/menuv0.1.0

projects/common/interactive/menu/menu-item-core.ts

Description#

Shared interaction core of the three menu item variants (CngxMenuItem, CngxMenuItemCheckbox, CngxMenuItemRadio) - previously a tripled block. Owns the AD registration surface (id, isHighlighted, label), the disabled-aware click handler with the announcer's itemDisabled phrase, and the pointer-highlight handler; only the activation step stays per-variant via onActivate.

Call from a field initializer (injection context required - the core injects ElementRef, the optional surrounding CngxActiveDescendant, the announcer factory, and the menu config). Interaction contract, preserved verbatim from the variants: a disabled click announces and stops; without a surrounding active-descendant a click is a complete no-op (no onActivate either); on the AD path the order is highlightByValue -> onActivate -> activateCurrent.

Signature#

injectMenuItemCore(options: CngxMenuItemCoreOptions)

Parameters#

Returns#

CngxMenuItemCore