Skip to main content

What does the status property of a form do?

The status property of a form (or of any control: FormControl, FormGroup, FormArray) shows its current validity state as a string.

It can take one of four values:

  • VALID - all checks pass;
  • INVALID - at least one validator fails;
  • PENDING - an asynchronous check is in progress (for example, a request to the server);
  • DISABLED - the form or field is disabled and does not take part in validation.

Example:

typescript
console.log(this.form.status); // 'VALID' or 'INVALID'

This property is convenient for reacting to state changes, for example to enable a button only when VALID.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.