Custom, cross-field and async validation, error messages
Learn Custom, cross-field and async validation, error messages (Module 11 · Angular Forms, Angular) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Your own rules • A custom validator is a function that receives a control and returns null when valid or an object describing the error: { noSpaces: true } . • Cross-field validation compares several fields (password and confirm password); attach it to the group . • Form error messages : translate error keys to friendly text in one place.
More lessons in Module 11 · Angular Forms
- Module 11 overview and checklist
- Template-driven vs reactive forms
- Form model: FormControl, FormGroup, FormArray, FormBuilder
- Form states and built-in validators
- Dynamic, nested and conditional forms, submit and reset
- Custom form controls and ControlValueAccessor
- Form accessibility, testing and performance