Skip to main content
cngx-src documentation

CngxErrorScopeContract

Interface

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

Referenced by#

Import#

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

Description#

Contract every CngxErrorScope (or external override) fulfils.

The scope encapsulates the "should errors be visible right now?" decision. A scope starts hidden (showErrors === false) and reveals when reveal is called - typically on form submit, on route navigation, or on programmatic error trigger.

Descendant directives (CngxErrorAggregator, CngxErrorState) read the scope's showErrors signal to gate their own visibility, so a single reveal() propagates atomically through the subtree.

Index#

Instance Properties#

scopeName#Signal
ReadonlyOptional

Optional name for programmatic registry lookup via CngxErrorRegistry.

showErrors#Signal
Readonly

Reactive flag - true when errors should be visible to the user.

Methods#

reset#void

Resets the scope to hidden (idempotent).

reveal#void

Reveals errors in this scope (idempotent).