Skip to main content

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