angular/packages/compiler-cli
Alex Rickabaugh 41b1410cb8 feat(forms): support binding number|null to <input type="text">
`<input type="number">` often does not provide the desired user experience when editing numbers in
a form. MDN even [describes](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/number#using_number_inputs)
how text inputs should be used in many cases instead, via `<input type="text" inputmode="numeric">`
or similar configurations. Previously, this did not work with Signal Forms without a custom input
component/directive.

This PR builds support for binding `number|null` models directly to `<input type="text">` native
controls via `[formField]`. When a model has a number or `null` value, signal forms will preserve
that status when the user makes edits/changes. Empty string values are converted to `null`, other
values are parsed as numbers, and a parse error is raised when a non-numeric value is entered.

Note that it's up to the UI developer to configure additional UI affordances such as setting an
appropriate `inputmode`, rejecting non-numeric keypresses, etc.

Fixes #66903
Fixes #66157
2026-03-19 15:26:34 -07:00
..
linker fix(compiler): ensure generated code compiles 2026-03-13 11:13:03 -06:00
private refactor(compiler-cli): Export hybrid analysis from bin 2026-03-10 11:41:50 -07:00
src feat(forms): support binding number|null to <input type="text"> 2026-03-19 15:26:34 -07:00
test feat(forms): support binding number|null to <input type="text"> 2026-03-19 15:26:34 -07:00
BUILD.bazel refactor(compiler-cli): Export hybrid analysis from bin 2026-03-10 11:41:50 -07:00
esbuild.config.js build: use esbuild from aspect rules (#62568) 2025-07-10 13:45:15 -07:00
index.ts refactor(compiler-cli): Export hybrid_analysis symbols 2026-03-10 10:18:36 -07:00
package.json build: update minimum supported Node.js versions 2026-02-25 07:57:18 -08:00
tsconfig-test.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00
tsconfig.json build: prepare for compiler-cli to be using ts_project (#61181) 2025-05-09 15:59:46 +00:00