Skip to main content
cngx-src documentation

injectErrorScope

Functioncommon/interactive/errorv0.1.0

projects/common/interactive/error-registry/inject-error-scope.ts

Description#

Creates a programmatic CngxErrorScopeContract, optionally registered under name in the ambient CngxErrorRegistry.

Use when an error scope must exist without a DOM host - e.g. inside a route guard, an HTTP interceptor, or a service that drives error visibility programmatically. When name is set and a registry is provided in the host environment, the scope auto-registers and auto-deregisters on the surrounding DestroyRef.

Must be called in an injection context (constructor, factory provider, runInInjectionContext).

Signature#

injectErrorScope(name?: string)

Parameters#

@paramname?string

Returns#

CngxErrorScopeContract