Note: Requires @angular/cdk package.
A modular directive that automatically displays error messages associated with form controls when validation errors occur. It creates an overlay to show the error, positioned relative to the host input element.
Usage of the zxControlErrors directive
You can also provide a custom component that matches your organisation style guide.
Additionally, you can provide an errors dictionary to add support for more error messages or extend ZX_CONTROL_ERRORS_DICTIONARY
object for matching all the error messages.
You can also provide custom error messages for a specific field as shown below.
import { ZxControlErrors } from '@zamolxis/control-errors';
Selector: zxControlErrors
Exported as: zxControlErrors
It is possible to configure the offsetY
and debounceTime
properties at the application (or component) level using the ZX_CONTROL_ERRORS_CONFIG
injection token, as shown below.