Title: @Input should support conversion from string to types · Issue #6919 · angular/angular · GitHub
Open Graph Title: @Input should support conversion from string to types · Issue #6919 · angular/angular
X Title: @Input should support conversion from string to types · Issue #6919 · angular/angular
Description: I didn't see any issues and I verified the code doesn't do the right thing (currently). It would be nice to have support for something like this: @Component({ /* ... */ }) class MyComponent implements AfterContentInit { @Input() myNumber...
Open Graph Description: I didn't see any issues and I verified the code doesn't do the right thing (currently). It would be nice to have support for something like this: @Component({ /* ... */ }) class MyComponent impleme...
X Description: I didn't see any issues and I verified the code doesn't do the right thing (currently). It would be nice to have support for something like this: @Component({ /* ... */ }) class MyComponent...
Opengraph URL: https://github.com/angular/angular/issues/6919
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@Input should support conversion from string to types","articleBody":"I didn't see any issues and I verified the code doesn't do the right thing (currently).\n\nIt would be nice to have support for something like this:\n\n``` typescript\n@Component({ /* ... */ })\nclass MyComponent implements AfterContentInit {\n @Input() myNumberInput: number;\n ngAfterContentInit() {\n assert(typeof this.myNumberInput == 'number');\n }\n}\n```\n\nRight now this does not work as attribute values (which are strings) are blindly set to the member without any regard to typing.\n\nUsing the reflection metadata from TypeScript we know the type of the property, which would allow us to do something as simple as \n\n``` typescript\nlet T = getTypeOfMember();\nsetValueOfMember(new T(stringValue));\n```\n\nWhich would also allow us to use Dates (or even custom classes).\n\nIf you want I can make a design doc for this and/or attempt a PR, to discuss potential implementations.\n","author":{"url":"https://github.com/hansl","@type":"Person","name":"hansl"},"datePublished":"2016-02-05T17:35:51Z","url":"https://github.com/angular/angular/issues/6919"}
| 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:f2772a06-3b43-4ab7-6137-12be3b69f742 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F5C:305B07:19EE0F1:2226A62:6B014795 |
| html-safe-nonce | be7bd7b1c7f79f7dadbe9bbeb4eefa2694912c7df3942c0c2eeffe2daa577e9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjVDOjMwNUIwNzoxOUVFMEYxOjIyMjZBNjI6NkIwMTQ3OTUiLCJ2aXNpdG9yX2lkIjoiODQyODY4MTgyMzc2MDczMTA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 31f0fa6dc271132920a9bc8f5f7347efbf4150ae3f28e3c2d0074cef66cb50c5 |
| hovercard-subject-tag | issue:131704782 |
| 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/6919/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ba1b1ae5766eb6e2fd57c9f5372555003ba9f6b34e033d28e582fc73c2fdfc10/angular/angular/issues/6919 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ba1b1ae5766eb6e2fd57c9f5372555003ba9f6b34e033d28e582fc73c2fdfc10/angular/angular/issues/6919 |
| og:image:alt | I didn't see any issues and I verified the code doesn't do the right thing (currently). It would be nice to have support for something like this: @Component({ /* ... */ }) class MyComponent impleme... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hansl |
| 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