Title: signal forms: string | null type is giving compile error, type errors while using it with primeng components · Issue #66570 · angular/angular · GitHub
Open Graph Title: signal forms: string | null type is giving compile error, type errors while using it with primeng components · Issue #66570 · angular/angular
X Title: signal forms: string | null type is giving compile error, type errors while using it with primeng components · Issue #66570 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? compiler, forms Is this a regression? Yes Description Form data type like this was working earlier, but now it gives type error: interface LoginData { email: string | null; password:...
Open Graph Description: Which @angular/* package(s) are the source of the bug? compiler, forms Is this a regression? Yes Description Form data type like this was working earlier, but now it gives type error: interface Log...
X Description: Which @angular/* package(s) are the source of the bug? compiler, forms Is this a regression? Yes Description Form data type like this was working earlier, but now it gives type error: interface Log...
Opengraph URL: https://github.com/angular/angular/issues/66570
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"signal forms: string | null type is giving compile error, type errors while using it with primeng components","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncompiler, forms\n\n### Is this a regression?\n\nYes\n\n### Description\n\nForm data type like this was working earlier, but now it gives type error:\n```ts\ninterface LoginData {\n email: string | null;\n password: string | null;\n rememberMe: boolean;\n}\n```\n\nForm:\n```ts\n loginModel = signal\u003cLoginData\u003e({\n email: null,\n password: null,\n rememberMe: false,\n });\n\n loginForm = form(this.loginModel);\n```\n\n### Please provide a link to a minimal reproduction of the bug\n\nhttps://stackblitz.com/edit/f6b2smnv?file=package.json,src%2Fapp%2Fapp.ts,src%2Fapp%2Fapp.html\n\n### Please provide the exception or error you saw\n\n```true\n[ERROR] TS2322: Type '`0x${string}` | null' is not assignable to type 'string'.\n Type 'null' is not assignable to type 'string'. [plugin angular-compiler]\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI : 21.1.0\nAngular : 21.1.0\nNode.js : 20.19.1\nPackage Manager : npm 10.8.2\nOperating System : linux x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 21.1.0 │ 21.1.0 │\n│ @angular/cli │ 21.1.0 │ 21.1.0 │\n│ @angular/common │ 21.1.0 │ 21.1.0 │\n│ @angular/compiler │ 21.1.0 │ 21.1.0 │\n│ @angular/compiler-cli │ 21.1.0 │ 21.1.0 │\n│ @angular/core │ 21.1.0 │ 21.1.0 │\n│ @angular/forms │ 21.1.0 │ 21.1.0 │\n│ @angular/platform-browser │ 21.1.0 │ 21.1.0 │\n│ @angular/router │ 21.1.0 │ 21.1.0 │\n│ rxjs │ 7.8.2 │ ~7.8.0 │\n│ typescript │ 5.9.3 │ ~5.9.3 │\n│ zone.js │ 0.16.0 │ ~0.16.0 │\n└───────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else?\n\nAlso getting one other type error after 21.1.0 update (was working fine with 20.0.7 formField change), but not tried it in stackblitz so not reporting yet, getting following error with for p-datepicker component (field type `Date | null`):\n```bash\nType 'readonly RegExp[]' is not assignable to type 'string'.ngtsc(2322)\ndeclare (property) FormField\u003cDate | null\u003e.formField: InputSignal\u003cFieldTree\u003cDate | null, string | number\u003e\u003e\n```","author":{"url":"https://github.com/imaksp","@type":"Person","name":"imaksp"},"datePublished":"2026-01-15T05:46:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/66570/angular/issues/66570"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4d41ed43-6527-24ed-1040-638b29e54ef4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9230:C9EB4:289F719:34FF1C0:696B66C7 |
| html-safe-nonce | 9f824c122df533095cc75b00b1b5a1dd7bbbe91ce8658e58e26935a696eebc75 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjMwOkM5RUI0OjI4OUY3MTk6MzRGRjFDMDo2OTZCNjZDNyIsInZpc2l0b3JfaWQiOiI1NTU3OTA3NTU4MDg2MzQ1NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e9036f2175776404ae44fd6efeadb7d4151281b72716c71a60cda5b63b1875f8 |
| hovercard-subject-tag | issue:3816102453 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/66570/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5cecd64919fef83aa4a75eb555d0d0628a155d71ba54a44b0d0dc4bbad4383b7/angular/angular/issues/66570 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5cecd64919fef83aa4a75eb555d0d0628a155d71ba54a44b0d0dc4bbad4383b7/angular/angular/issues/66570 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? compiler, forms Is this a regression? Yes Description Form data type like this was working earlier, but now it gives type error: interface Log... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | imaksp |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width