Suggest an editImprove this articleRefine the answer for “What is a validator in Angular?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)A **validator** in Angular is a function that checks the value of a form field and returns the result of the check. **Key point:** validators help Angular automatically determine the `valid` / `invalid` state and show errors to the user.Shown above the full answer for quick recall.Answer (EN)ImageA validator in Angular is a **function that checks the value of a form field and returns the result of the check**. If the value is correct: `null` is returned. If there is an error: an object with a description is returned, for example: ```typescript { required: true } or { minlength: { requiredLength: 5, actualLength: 3 } } ``` There are two types: - **Synchronous validators** - run immediately (`Validators.required`, `Validators.email`, `Validators.minLength`, and so on). - **Asynchronous validators** - run with a delay (for example, a request to the server to check a username). Example: ```typescript email = new FormControl('', [Validators.required, Validators.email]); ``` Validators help Angular **automatically determine the** `valid` **/** `invalid` **state** and show errors to the user.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.