Suggest an editImprove this articleRefine the answer for “What types of validators are there?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Angular has **two types of validators**: synchronous and asynchronous. **Key point:** synchronous validators are checked immediately and are used most often, while asynchronous validators return a `Promise` or `Observable` when the check takes time, for example a server request.Shown above the full answer for quick recall.Answer (EN)ImageAngular has two types of validators: ## Synchronous validators - Checked immediately, without waiting. - Used most often. - Examples of built-in ones: - `Validators.required` - the field must not be empty; - `Validators.email` - checks that the e-mail is correctly formatted; - `Validators.minLength(n)` / `Validators.maxLength(n)` - limit the length; - `Validators.pattern(regex)` - checks against a regular expression. - You can write your own, returning `null` (if all is fine) or an error object. ## Asynchronous validators - Used when the check takes time, for example a request to the server. - Return a `Promise` or `Observable`. - Example: checking whether a username is already taken: ```typescript checkUsername(control: FormControl) { return this.api.checkUser(control.value).pipe( map(isTaken => (isTaken ? { usernameTaken: true } : null)) ); } ``` Both types can be applied to individual `FormControl` instances as well as to entire `FormGroup` instances.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.