Skip to main content
cngx-src documentation

CngxErrorAggregatorContract

Interface

projects/common/interactive/error-aggregator/error-aggregator.token.ts

Referenced by#

Import#

import { CngxErrorAggregatorContract } from '@cngx/common/interactive'

Description#

Contract every CngxErrorAggregator (or external override) fulfils.

The aggregator is the live A11y surface - it computes hasError / errorCount / activeErrors / errorLabels / shouldShow / announcement from its registered sources and exposes them to the surrounding host. Sources register via addSource on init and deregister via removeSource on teardown.

Index#

Instance Properties#

activeErrors#Signal
Readonly

Keys of currently active error sources, in registration order.

announcement#Signal
Readonly

SR-friendly announcement text - joins active labels into one phrase.

errorCount#Signal
Readonly

Count of currently active error sources.

errorLabels#Signal
Readonly

Labels of currently active error sources (only entries with non-null labels).

hasError#Signal
Readonly

true when at least one registered source's condition is true.

shouldShow#Signal
Readonly

true when errors should be visible - hasError AND scope reveal-state.

Methods#

addSource#void
addSource(entry: CngxErrorAggregatorSourceEntry)

Registers (or replaces) a source by key.

removeSource#void
removeSource(key: string)

Deregisters the source with key (no-op if absent).

@paramkeystring