Repository navigation
Conversation
Clearing a number or date input sets a number or `Date` field to `null`, so type those fields as `number | null` and `Date | null`. Also explain that date inputs only use `YYYY-MM-DD` strings when the field is a string, and drop the `new Date()` conversion tip, since a `Date | null` field receives `Date` objects directly.
…examples Clearing an `<input type="number">` bound with `[formField]` sets the field to `null`, so a model typed as `number` does not describe the values it can hold. The `min()`/`max()` example in the validation guide, the Order, Age and Inventory examples in the form logic guide and both NG8022 examples still bound a non-nullable number to a number input. Type those fields as `number | null`. Where a `when` condition compares the value with `<`, fall back to `0` for `null`, which keeps the current behavior and compiles with the nullable type.
MeAkib
force-pushed
the
docs/signal-forms-nullable-models
branch
from
December 1, 2026 05:51
a93b2b6 to
aa729be
Compare
Contributor
Author
|
@JeanMeche I added a second commit after your approval, following the note on #72231. A few more examples still bound a non-nullable
They now use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clearing a number or date input sets a number or
Datefield tonull, so type those fields asnumber | nullandDate | null. Also explain that date inputs only useYYYY-MM-DDstrings when the field is a string, and drop thenew Date()conversion tip, since aDate | nullfield receivesDateobjects directly.The second commit applies the same change to the number input examples in the validation guide, the form logic guide and the NG8022 error page.