0Pricing
Angular Academy · Lesson

Handling Disabled and Touched States

Reflect form state in your control.

Beyond The Value

A complete custom control respects two more form concepts: disabled state and touched state. These drive UX and validation display.

setDisabledState

Angular calls setDisabledState when the form control is disabled or enabled (for example via control.disable()). Reflect it in your component.

disabled = false;

setDisabledState(isDisabled: boolean): void {
  this.disabled = isDisabled;
}

All lessons in this course

  1. The ControlValueAccessor Interface
  2. Writing and Registering Values
  3. Handling Disabled and Touched States
  4. Validation in Custom Controls
← Back to Angular Academy