> For the complete documentation index, see [llms.txt](https://angular-fast-forms.codentury.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://angular-fast-forms.codentury.com/custom-validation/sync.md).

# Sync Validator

## Creation

A custom sync validator can be created with a validator factory seen in the following example.

```typescript
@Validator({
  id: 'custom-required',
  type: 'sync'
})
@Injectable()
export class CustomRequiredValidator implements BaseValidator {

  createValidator(args: string[]): ValidatorFn {
    return control => {
      if (control.value) {
        return null;
      } else {
        return {
          required: true
        };
      }
    };
  }
}
```
