• Overview
@angular/forms/signals

hidden

function

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

API

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

hidden

void

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

If a field may be hidden it is recommended to guard it with an @if in the template: ```

@parampathFieldPath<TValue, TPathKind>

The target path to add the hidden logic to.

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

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

@returnsvoid

Description

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

If a field may be hidden it is recommended to guard it with an @if in the template: ```

Jump to details