CngxDialogAriaRegistry
projects/common/dialog/dialog/dialog-aria-registry.ts
Referenced by#
Import#
import { CngxDialogAriaRegistry } from '@cngx/common/dialog'
Description#
Registration contract between CngxDialog and its labelling sources.
Content queries only see nodes declared in the projection template, so a
programmatically opened dialog (content created into the outlet's
ViewContainerRef) is invisible to contentChild(). Sources therefore
push their handles through this token instead of being pulled by query -
the same inversion as CNGX_POPOVER_ARROW_BOUNDS.
CngxDialog provides the token via useExisting and stays the single
owner of the aria-describedby derivation: directives sharing the dialog
host must never bind attr.aria-describedby themselves (two host
bindings on one attribute clobber each other) - they register an id here
and the dialog merges it.
Each register* call returns a release function (single-slot per kind:
one title, one description, N anonymous describedby ids) - tie it to
DestroyRef.onDestroy.
Internal contract - intentionally not exported from public-api.ts.
Index#
Methods#
registerDescribedBy(id: string | Signal) Register a supplemental aria-describedby id (e.g. an interaction
instruction). Accepts a plain string for ids that are fixed for the
registration's lifetime; pass a signal only when the id itself changes.
string | SignalregisterDescription(handle: DialogLabelHandle)Register the primary description source for aria-describedby.
registerTitle(handle: DialogLabelHandle)Register the labelling source for aria-labelledby and the open announce.