Title: @angular/elements uses (internal) property name for custom element properties, but template name for attributes · Issue #58302 · angular/angular · GitHub
Open Graph Title: @angular/elements uses (internal) property name for custom element properties, but template name for attributes · Issue #58302 · angular/angular
X Title: @angular/elements uses (internal) property name for custom element properties, but template name for attributes · Issue #58302 · angular/angular
Description: Angular edit Angular elements defines (Object.defineProperty) a property for each input of an element's component, as well as an HTML attribute which feeds into each property. Each input is thus represented by a property/attribute pair, ...
Open Graph Description: Angular edit Angular elements defines (Object.defineProperty) a property for each input of an element's component, as well as an HTML attribute which feeds into each property. Each input is thus re...
X Description: Angular edit Angular elements defines (Object.defineProperty) a property for each input of an element's component, as well as an HTML attribute which feeds into each property. Each input is thu...
Opengraph URL: https://github.com/angular/angular/issues/58302
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@angular/elements uses (internal) property name for custom element properties, but template name for attributes","articleBody":"## Angular edit\n\nAngular elements defines (`Object.defineProperty`) a property for each input of an element's component, as well as an HTML attribute which feeds into each property. Each input is thus represented by a property/attribute pair, as in the real DOM.\n\nHowever, the way we name these things differs. `createCustomElement` uses the template name of the input for the attribute API, but the property name of the input for the DOM/property API. This was likely done intentionally as it makes _some_ sense - property name for properties - but it doesn't consider that the property name is meant to be an implementation detail of a component and shouldn't end up on its public API.\n\nFixing this would be a breaking change.\n\n## Original Issue\n\nWhen declaring an input with alias inside of a component and use `createCustomElement` of that component.\nex.\n\n```\nreadonly name = input\u003cstring>(\n 'name',\n { alias: 'customName' },\n );\n```\n\nOn the actual web-component there are no such attribute as `customName`, only `name` will exist and work.\n\n\nLooks like that `ComponentFactory` at method `resolveComponentFactory` which returns `inputs` array with `propName` of each input is not actually aliased name.\n\nhttps://github.com/angular/angular/blob/main/packages/elements/src/component-factory-strategy.ts#L46","author":{"url":"https://github.com/OlehPetrykUA","@type":"Person","name":"OlehPetrykUA"},"datePublished":"2024-10-22T14:54:19Z","url":"https://github.com/angular/angular/issues/58302"}
| 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:3d67bc5b-e6fc-097f-444c-5f1801fe80ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0EC:2C4BED:DF82FB:11D4876:6B010731 |
| html-safe-nonce | de6881d755ee39574fe8c86f1a64279c512af7e57d3e3c32de17bc998e1786f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEVDOjJDNEJFRDpERjgyRkI6MTFENDg3Njo2QjAxMDczMSIsInZpc2l0b3JfaWQiOiI2MzgyMDYwNTgzMTcyMjQ1Mjk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e3d7b255c72daff8efc2d0421a64b79a04016bfebc32958f807dfe45e4452e06 |
| hovercard-subject-tag | issue:2605703409 |
| 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/58302/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4ee2133b0e3b3e74b9dadcaecae49c0e846802835504ef3ce67aad92d47e402/angular/angular/issues/58302 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4ee2133b0e3b3e74b9dadcaecae49c0e846802835504ef3ce67aad92d47e402/angular/angular/issues/58302 |
| og:image:alt | Angular edit Angular elements defines (Object.defineProperty) a property for each input of an element's component, as well as an HTML attribute which feeds into each property. Each input is thus re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | OlehPetrykUA |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width