Skip to content

feat(forms): introduce extractValue utility for signal forms#67063

Open
kirjs wants to merge 1 commit intoangular:mainfrom
kirjs:extract
Open

feat(forms): introduce extractValue utility for signal forms#67063
kirjs wants to merge 1 commit intoangular:mainfrom
kirjs:extract

Conversation

@kirjs
Copy link
Contributor

@kirjs kirjs commented Feb 13, 2026

Adds extractValue utility to the forms/signals/compat package. This function extracts the raw value from a FieldTree, recursively unwrapping AbstractControl instances.

It also allows to filter out only dirty/touched/enabled values or their combination to help reproduce ReactiveForms behavior.

Key Features

  • Unwraps AbstractControls: Automatically resolves any AbstractControl instances in the FieldTree to their underlying values (essential for compatForm).
  • Structured Filtering: Adds ExtractFilter to selectively extract fields based on state (dirty, touched, enabled).
  • Array Preservation: Unlike Reactive Forms which removes filtered array items, extractValue preserves index positions by setting filtered items to undefined.

Usage

const f = compatForm(signal({first: 'Alice', last: new FormControl('Doe')}));
extractValue(f); // {first: 'Alice', last: 'Doe'}

// With filter
extractValue(f, {touched: true});

Adds `extractValue` utility to the `forms/signals/compat` package. This function extracts the raw value from a `FieldTree`, recursively unwrapping `AbstractControl` instances.

It also allows to filter out only dirty/touched/enabled values or their combination to help reproduce ReactiveForms behavior.
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: forms labels Feb 13, 2026
@ngbot ngbot bot added this to the Backlog milestone Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: forms detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant