• Overview
@angular/forms/signals

disabled

function

Adds logic to a field to conditionally disable it. A disabled field does not contribute to the validation, touched/dirty, or other state of its parent field.

API

function disabled<TValue, TPathKind extends PathKind = PathKind.Root>(
  path: FieldPath<TValue, TPathKind>,
  logic?:
    | string
    | NoInfer<LogicFn<TValue, string | boolean, TPathKind>>
    | undefined,
): void;

disabled

void

Adds logic to a field to conditionally disable it. A disabled field does not contribute to the validation, touched/dirty, or other state of its parent field.

@parampathFieldPath<TValue, TPathKind>

The target path to add the disabled logic to.

@paramlogicstring | NoInfer<LogicFn<TValue, string | boolean, TPathKind>> | undefined

A reactive function that returns true (or a string reason) when the field is disabled, and false when it is not disabled.

@returnsvoid
Jump to details