angular/packages/compiler-cli/test
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
..
compliance refactor(compiler): add ts-ignore comment on factory functions 2026-03-18 14:05:18 -06:00
ngtsc feat(forms): support binding number|null to <input type="text"> 2026-03-19 15:26:34 -07:00
BUILD.bazel test(compiler): remove zone-based testing utilities 2026-02-05 16:56:55 -08:00
extract_i18n_spec.ts feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
mocks.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
perform_compile_spec.ts feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
perform_watch_spec.ts feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
test_support.ts feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00
typescript_support_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
version_helpers_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00