Form Field
Display a form field to handle errors and hints.
Installation
npx nx g @spartan-ng/cli:ui formfield
ng g @spartan-ng/cli:ui formfield
Usage
Examples
Default
Error
With Form
Changing when error messages are shown
By default, these error messages are shown when the control is invalid and the user has interacted with (touched) the element or the parent form has been submitted. If you wish to override this behavior (e.g. to show the error as soon as the invalid control is dirty or when a parent form group is invalid), you can use the ErrorStateMatcher
provider.
For convenience, ShowOnDirtyErrorStateMatcher
is available in order to globally cause input errors to show when the input is dirty and invalid