Skip to content

docs(forms): clarify boxed values in FormBuilder API#68799

Open
mohanrajvenkatesan23-04 wants to merge 1 commit into
angular:mainfrom
mohanrajvenkatesan23-04:docs/issue-36746-formbuilder-boxed-values
Open

docs(forms): clarify boxed values in FormBuilder API#68799
mohanrajvenkatesan23-04 wants to merge 1 commit into
angular:mainfrom
mohanrajvenkatesan23-04:docs/issue-36746-formbuilder-boxed-values

Conversation

@mohanrajvenkatesan23-04
Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

The JSDoc on FormBuilder.control, FormBuilder.group, FormBuilder.array,
NonNullableFormBuilder.control, ControlConfig, and FormControlState
mentions "boxed values" only briefly — without defining what shape is
accepted, how it interacts with the AbstractControlOptions argument, or
how it maps to the FormControl constructor. Issue #36746 reports that
this is confusing for users trying to initialize a control as disabled.

Issue Number: #36746

What is the new behavior?

The JSDoc on every FormBuilder factory now:

  • Explicitly defines a "boxed value" (FormControlState<T>
    {value: T, disabled: boolean}).
  • Enumerates every shape accepted as a child-control entry (raw value /
    boxed value / ControlConfig tuple / already-constructed
    AbstractControl).
  • Calls out the easy-to-confuse {validators, asyncValidators, updateOn, nonNullable} options object so readers do not pass it where a value is
    expected.
  • Cross-references the FormControl constructor so the two surfaces stay
    visibly consistent.
  • Provides minimal copy-pasteable examples for raw values, boxed values,
    and ControlConfig tuples.

No runtime behavior or public-API surface is changed — JSDoc only. Also
fixes a pre-existing typo in FormBuilder.control ("the type of" → "the
type of").

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Documentation-only change. No unit tests added (docs: is exempt from the
"tests must be added" rule per CONTRIBUTING.md). Public-API goldens were
not regenerated because no exported symbol or signature changed.

Expand the JSDoc on FormBuilder.control, FormBuilder.group,
FormBuilder.array, NonNullableFormBuilder.control, ControlConfig, and
FormControlState to explicitly document the "boxed value"
({value, disabled}) shape: where it is accepted, how it differs from
the AbstractControlOptions configuration object, and how it
corresponds to the FormControl constructor's first argument. Add
usage examples for raw values, boxed values, and ControlConfig tuples
so readers do not confuse them with the options argument.

Closes angular#36746
@pullapprove pullapprove Bot requested a review from JeanMeche May 19, 2026 16:42
@angular-robot angular-robot Bot added area: docs Related to the documentation area: forms labels May 19, 2026
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 19, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ngbot ngbot Bot added this to the Backlog milestone May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation area: forms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant