-
Notifications
You must be signed in to change notification settings - Fork 5
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
- If the field indicates more than one error, they will all be displayed.
- FormControl is transmitted only once.
- Now all validations should be added to validators, in this way we can be sure of the same input and form control flow/values
- **REQUIRED ** - pass only formControl if the input is required
- **LENGTH ** - pass formControl, min and max length that the input must have. Use ValidationConstants.
- DATE FORMAT - pass formControl and minMaxDate flag (boolean) that will check date format and date range.
- 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:
The OLD ONE: