Skip to content

Validation Hint Tutorial

Oleksandra Lytvynets edited this page May 15, 2022 · 8 revisions

Validation Hint component accepts form-control for validation and displays ALL the errors

Only one component can now be used for all validations.

  1. If the field indicates more than one error, they will all be displayed.
  2. FormControl is transmitted only once.
  3. Now all validations should be added to validators, in this way we can be sure of the same input and form control flow/values

HOW TO USE

  1. **REQUIRED ** - pass only formControl if the input is required
  2. **LENGTH ** - pass formControl, min and max length that the input must have. Use ValidationConstants. image
  3. DATE FORMAT - pass formControl and minMaxDate flag (boolean) that will check date format and date range.
  4. Check that the FormGroup/FormControls from the ts file have EXACT same validations (use the same values, constants, regex). The validation hint will be displayed only if the formcontrol is Invalid.

Example od USE: imageimage

The OLD ONE: image