mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs(forms): transformedValue parse error wiring
(cherry picked from commit 547ed65b6f)
This commit is contained in:
parent
70e4c7fbab
commit
fe7b26e403
1 changed files with 9 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ import type {OneOrMany} from './types';
|
|||
*/
|
||||
export interface ParseResult<TValue> {
|
||||
/**
|
||||
* The parsed value, if parsing was successful.
|
||||
* The parsed value. If omitted, the model is not updated.
|
||||
*/
|
||||
readonly value?: TValue;
|
||||
/**
|
||||
|
|
@ -75,6 +75,14 @@ export interface TransformedValueSignal<TRaw> extends WritableSignal<TRaw> {
|
|||
* representation into an underlying model value. For example, a numeric input that displays and
|
||||
* accepts string values but stores a number.
|
||||
*
|
||||
* Parse errors are exposed via the returned signal’s `parseErrors()` property.
|
||||
* When `transformedValue` is used within a Signal Forms field context, parse errors are also
|
||||
* reported to the nearest field automatically. When no field context is present, no automatic
|
||||
* reporting occurs and `parseErrors` can be consumed directly.
|
||||
*
|
||||
* Note: `parse` may return both a `value` and an `error`. Returning `value` updates the model;
|
||||
* omitting it leaves the model unchanged.
|
||||
*
|
||||
* @param value The model signal to synchronize with.
|
||||
* @param options Configuration including `parse` and `format` functions.
|
||||
* @returns A `TransformedValueSignal` representing the raw value with parse error tracking.
|
||||
|
|
|
|||
Loading…
Reference in a new issue