Search⌘ K
AI Features

Form Controller Status

Explore Angular form controller statuses to manage reactive form validation effectively. Understand how properties like touched, dirty, and pending improve user input handling by controlling when and how validation messages appear for a better user experience.

We'll cover the following...

At the moment, the error messages will appear instantaneously because validation is performed when the component loads. The user hasn’t had a chance to fill out the form. Typically, we want to wait until the user has provided a value before we validate it.

One workaround for this dilemma is to check if the user sends a value as an input. Every form controller comes with various status properties to help us understand what has been done to the input.

Controller statuses

Here’s a list of statuses. They’re all boolean values.

Status Description
valid The input is valid.
invalid The input is invalid.
pending Validation is still being performed on the input.
...