CngxFieldErrors
projects/forms/field/field-errors.component.ts
Import#
import { CngxFieldErrors } from '@cngx/forms/field'
Description#
Auto-renders validation errors from the CNGX_ERROR_MESSAGES registry.
Place inside a cngx-form-field. Errors are only shown after the touched gate
(user has interacted with the field). Each error is matched by its kind against
the registered message functions.
Supports an optional custom template for per-error rendering while keeping auto-resolution from the registry.
Use CngxError instead if you need full control over error rendering.
Do not use both CngxFieldErrors and CngxError in the same form field.
Default rendering
<cngx-field-errors />Custom error template
<cngx-field-errors>
<ng-template let-message="message" let-kind="kind" let-index="index">
<span class="my-error"><svg>...</svg> {{ message }}</span>
</ng-template>
</cngx-field-errors>