FormControl

Tracks the value and validation state of a single form field.

Since Angular 2+ Spec ↗

Syntax

new FormControl(initialValue, validators?)

Parameters

NameTypeRequiredDescription
initialValue any No Initial value (or a state object with disabled).
validators ValidatorFn | ValidatorFn[] No Synchronous validators for the control.

Returns

FormControl — A reactive control with value and status.

Examples

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';

@Component({
  selector: 'app-x',
  standalone: true,
  imports: [ReactiveFormsModule],
  template: `<input [formControl]="email" />`,
})
export class XComponent {
  email = new FormControl('', { nonNullable: true, validators: [Validators.email] });
}

Notes

Bind with `[formControl]` and import ReactiveFormsModule. Use `nonNullable: true` so reset() restores the initial value instead of null. Read state via value, valid, errors, and the valueChanges/statusChanges observables.