• Overview
@angular/forms/signals

readonly

function

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

API

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

readonly

void

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

@parampathFieldPath<TValue, TPathKind>

The target path to make readonly.

@paramlogicNoInfer<LogicFn<TValue, boolean, TPathKind>>

A reactive function that returns true when the field is readonly.

@returnsvoid
Jump to details