Validation Hint Tutorial - ita-social-projects/OoS-Frontend GitHub Wiki
Validation Hint component accepts form-control for validation and displays ALL the errors
Only one component can now be used for all validations.
- 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
HOW TO USE
- **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: