• Overview
@angular/forms/signals/compat

extractValue

function
stablesince v22.0

Utility to unwrap a FieldTree into its underlying raw value.

API

function extractValue<T>(field: FieldTree<T>): RawValue<T>;
function extractValue<T>(
  field: FieldTree<T>,
  filter: ExtractFilter,
): DeepPartial<RawValue<T>>;
function extractValue<T>(field: FieldTree<T>): RawValue<T>;

Utility to unwrap a FieldTree into its underlying raw value.

This function is recursive, so if the field tree represents an object or an array, the result will be an object or an array of the raw values of its children.

@paramfieldFieldTree<T>

The field tree to extract the value from.

@returnsRawValue<T>

The raw value of the field tree.

function extractValue<T>(field: FieldTree<T>, filter: ExtractFilter): DeepPartial<RawValue<T>>;

Utility to unwrap a FieldTree into its underlying raw value.

This function is recursive, so if the field tree represents an object or an array, the result will be an object or an array of the raw values of its children.

@paramfieldFieldTree<T>

The field tree to extract the value from.

@paramfilterExtractFilter

Criteria to include only fields matching certain state (dirty, touched, enabled).

@returnsDeepPartial<RawValue<T>>

A partial value containing only the fields matching the filter, or undefined if none match.

Description

Utility to unwrap a FieldTree into its underlying raw value.

This function is recursive, so if the field tree represents an object or an array, the result will be an object or an array of the raw values of its children.

Jump to details