TwitterGithub

Form Field

Display a form field to handle errors and hints.

This is your email address.

Installation

npx nx g @spartan-ng/cli:ui form-field

Usage

Examples

Default

This is your email address.

Error

Your name is required

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

Label Icon