Title: [Feature Request] Let select [formField] receive not only string but also number · Issue #69478 · angular/angular · GitHub
Open Graph Title: [Feature Request] Let select [formField] receive not only string but also number · Issue #69478 · angular/angular
X Title: [Feature Request] Let select [formField] receive not only string but also number · Issue #69478 · angular/angular
Description: Description To avoid the following error, why don't we allow select's [formField] to be number? number cannot be assigned to string in [formField]="form.productId". import { Component, signal } from '@angular/core'; import { form, FormFi...
Open Graph Description: Description To avoid the following error, why don't we allow select's [formField] to be number? number cannot be assigned to string in [formField]="form.productId". import { Component, signal } fro...
X Description: Description To avoid the following error, why don't we allow select's [formField] to be number? number cannot be assigned to string in [formField]="form.productId". import { Compo...
Opengraph URL: https://github.com/angular/angular/issues/69478
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature Request] Let select [formField] receive not only string but also number","articleBody":"\n### Description\n\nTo avoid the following error, why don't we allow `select`'s `[formField]` to be `number`? \n\n\n> `number` cannot be assigned to `string` in `[formField]=\"form.productId\"`.\n \n```ts\nimport { Component, signal } from '@angular/core';\nimport { form, FormField } from '@angular/forms/signals';\ninterface Product {\n id: number;\n name: string;\n}\ninterface Order {\n productId: number;\n quantity: number;\n}\n@Component({\n selector: 'app-selector',\n imports: [FormField],\n template: `\n \u003cselect [formField]=\"form.productId\">\n \u003coption value=\"\">Select a product\u003c/option>\n @for (p of products; track p.id) {\u003coption [value]=\"p.id\">{{ p.name }}\u003c/option>}\n \u003c/select>\n \u003chr />\n selected: {{ products[form.productId().value() - 1] }}\n `,\n})\nexport class Selector {\n model = signal\u003cOrder>({ productId: 0, quantity: 0 });\n form = form(this.model);\n products: Product[] = [\n { id: 1, name: 'apple' },\n { id: 2, name: 'bread' },\n { id: 3, name: 'candy' },\n ];\n}\n```\n\n","author":{"url":"https://github.com/suugbut","@type":"Person","name":"suugbut"},"datePublished":"2026-06-23T09:20:30Z","url":"https://github.com/angular/angular/issues/69478"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:269e3eae-0bcf-c450-3fc3-81d4d73ca0d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8458:1CCECA:DAD38F:1244E67:6B01DBEE |
| html-safe-nonce | a388e3c72782359c0b5f888005ff1c79c2edc40b158aa82aab7fb0e8d139820d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDU4OjFDQ0VDQTpEQUQzOEY6MTI0NEU2Nzo2QjAxREJFRSIsInZpc2l0b3JfaWQiOiI4MDc0ODAwMTUwNTAzMDg3MDg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fe4a74b610f3bfe3c2f8831bbb8b864c3b3ff19e11f166077a31e4e8c094752a |
| hovercard-subject-tag | issue:4724409112 |
| 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/69478/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d8c28e17d424ed58106e0d5e5e7c2c99ef5285552b390eb5281cd55d0b9d68da/angular/angular/issues/69478 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d8c28e17d424ed58106e0d5e5e7c2c99ef5285552b390eb5281cd55d0b9d68da/angular/angular/issues/69478 |
| og:image:alt | Description To avoid the following error, why don't we allow select's [formField] to be number? number cannot be assigned to string in [formField]="form.productId". import { Component, signal } fro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | suugbut |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width