Skip to content

docs(forms): add applyWhenValue example for union validation#68853

Open
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:docs/signal-forms-applywhenvalue
Open

docs(forms): add applyWhenValue example for union validation#68853
BHUVANSH855 wants to merge 1 commit into
angular:mainfrom
BHUVANSH855:docs/signal-forms-applywhenvalue

Conversation

@BHUVANSH855
Copy link
Copy Markdown
Contributor

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 Signal Forms validation guide documents validation helpers such as applyEach(), but it does not explain how to apply validation conditionally for union or variant-based forms using applyWhenValue().

Issue Number: #66906

What is the new behavior?

Adds a new section to the Signal Forms validation guide showing how to use applyWhenValue() with discriminated unions.

The example demonstrates how different validation rules can be applied depending on the active variant.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Inspired by the discussion and examples linked in the issue and StackOverflow references.

@pullapprove pullapprove Bot requested a review from JeanMeche May 21, 2026 11:48
@angular-robot angular-robot Bot added area: docs Related to the documentation area: forms labels May 21, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 21, 2026
@JeanMeche JeanMeche requested a review from bencodezen May 21, 2026 11:52
@BHUVANSH855 BHUVANSH855 deleted the docs/signal-forms-applywhenvalue branch May 21, 2026 12:02
@BHUVANSH855 BHUVANSH855 restored the docs/signal-forms-applywhenvalue branch May 21, 2026 12:05
@BHUVANSH855 BHUVANSH855 reopened this May 21, 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