CngxErrorScope
projects/common/interactive/error-scope/error-scope.directive.ts
Import#
import { CngxErrorScope } from '@cngx/common/interactive'
Description#
Marks a DOM subtree as an error visibility scope.
The scope starts hidden - descendant aggregators and error states do
not reveal until the consumer calls reveal, typically via a
(submit) handler, a route guard, or an HTTP interceptor reveal-on-422
pattern.
Provides CNGX_ERROR_SCOPE so any descendant
(CngxErrorAggregator, CngxErrorState, the form-field presenter in
Phase 6b) can read showErrors reactively without injecting a
concrete class.
<form [cngxErrorScope] cngxErrorScopeName="checkout"
(submit)="scope.reveal(); save()" #scope="cngxErrorScope">
<input [cngxErrorState]="email().invalid()" />
</form>Metadata#
Providers#
CNGX_ERROR_SCOPE- useExisting
CngxErrorScope