René's URL Explorer Experiment


Title: Proposal: optional namespaces for inputs bindings · Issue #12557 · angular/angular · GitHub

Open Graph Title: Proposal: optional namespaces for inputs bindings · Issue #12557 · angular/angular

X Title: Proposal: optional namespaces for inputs bindings · Issue #12557 · angular/angular

Description: I'm submitting a ... bug report => search github for a similar issue or PR before submitting feature request support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIB...

Open Graph Description: I'm submitting a ... bug report => search github for a similar issue or PR before submitting feature request support request => Please do not submit support request here, instead see https://github...

X Description: I'm submitting a ... bug report => search github for a similar issue or PR before submitting feature request support request => Please do not submit support request here, instead see http...

Opengraph URL: https://github.com/angular/angular/issues/12557

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Proposal: optional namespaces for inputs bindings","articleBody":"\u003c!--\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\n-->\n\n**I'm submitting a ...**\n- [ ] bug report => search github for a similar issue or PR before submitting\n- [x] feature request\n- [ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n## Problem\n\nTechnically, it's totally possible that there are multiple directives on the same element that bind to the same property (name). Currently there's no way to explicitly tell Angular which directive property we want to bind to. \n\n_This is especially problematic if the consumer doesn't have control over the directive (e.g. 3rd party directives)_\n\nExample:\n\n```\n@Directive({\n  selector: '[one]'\n})\nclass One {\n  @Input() foo;\n}\n\n@Directive({\n  selector: '[two]'\n})\nclass Two {\n  @Input() foo;\n}\n```\n\nThose two directives can be used like this:\n\n```\n\u003cANY one two [foo]=\"someExpr\">\u003c/ANY>\n```\n\nBy looking at the template we don't know which directive we're actually binding to + we can't be explicit about it either.\n### Current behaviour\n\nThe code above binds `someExpr` to both directive `foo` properties.\n## Proposals\n\nI discussed this with @cburgdorf and we came up with the following **possible** solutions, both with their up and downsides.\n### 1. Directive-Attribute/Property order defines binding receivers\n\nThe directive-attribute and property order on the host element defines which expression is bound to which directive prop. Example:\n\n```\n\u003cdiv one [foo]=\"boundToOne\" two [foo]=\"boundToTwo\">\u003c/div>\n```\n\nSame for\n\n```\n\u003cdiv one two [foo]=\"boundToOne\" [foo]=\"boundToTwo\">\u003c/div>\n```\n\n^ This works, because Angular has its own HTML parser and can actually identify the order of attributes (which browsers can’t guarantee AFAIK)\n#### Upsides\n- Easy to grok\n- Kinda intuitive\n#### Downsides\n- Gets hairy the more directives are applied to one host element (Chances might be rather low, that this happens with many directives tho)\n### 2. Introduce optional namespace for property bindings\n\nAnother option would be to introduce some explicit namespaces (maybe by taking advantage of `exportAs`?)\n\nAssuming:\n\n```\n@Directive({\n  selector: '[one]',\n  exportAs: 'one'\n})\nclass One {\n  @Input() foo;\n}\n\n@Directive({\n  selector: '[two]',\n  exportAs: 'two'\n})\nclass Two {\n  @Input() foo;\n}\n```\n\n^ Notice how both directives use `exportAs`. That name could be used by the consumer as well:\n\n```\n\u003cdiv one [one.foo]=\"boundToOne\" two [two.foo]=\"boundToTwo\">\u003c/div>\n```\n\nThis would work in any order:\n\n```\n\u003cdiv [one.foo]=\"…\" two one [two.foo]=\"…\">\n```\n\nAnother possible syntax would be\n\n```\n\u003cdiv [one#foo]=\"…\">\n```\n\nCanonical version:\n\n```\n\u003cdiv bind-one-foo=\"…\"\n```\n\nThis works for events too.\n#### Possible problems with this approach\n\nOne problem it would introduce though (if we’d rely on `exportAs`), the consumer also doesn’t have control over `exportAs` values of 3rd party directives either. So if we have:\n\n```\n@Directive({\n  selector: '[one]',\n  exportAs: 'one'\n})\nexport class One {…}\n\n@Directive({\n  selector: '[two]',\n  exportAs: 'one'\n})\nexport class Two {…}\n```\n\n^ Notice how both directives `exportAs: 'one'`\n\nThis would kind of result in the same problem, as both directives are exported as `one`. However, OTOH this exact same problem exists already when getting directive instance references in the template:\n\n```\n\u003cdiv one two #foo=\"one\">\u003c/div>\n```\n\n^ here, we can’t say if `foo` is `One` or `Two`. In fact, Angular throws in that case\n\n```\nzone.js:344Unhandled Promise rejection: Template parse errors:\nReference \"#foo\" is defined several times (\"\u003cdiv one two [ERROR ->]#foo=\"one\">\u003c/div>\n\"):\n```\n### Final thought\n\nSo then, I’d say this boils down to always prefixing the `exportAs` value, then this might work. E.g. forms directives do the exactly the same (`ngModel`, `ngForm`, ...)\n","author":{"url":"https://github.com/0x-r4bbit","@type":"Person","name":"0x-r4bbit"},"datePublished":"2016-10-27T08:31:23Z","url":"https://github.com/angular/angular/issues/12557"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ecc3102b-4400-ca45-88fd-8fe7620fc1be
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id89FC:22DB35:11889E7:1685FE9:6B010A60
html-safe-nonce5be0cbf46f8137de7575b30b0e69d5ab4d8ee5667b3b846eb1fbb5e3be4866fc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUZDOjIyREIzNToxMTg4OUU3OjE2ODVGRTk6NkIwMTBBNjAiLCJ2aXNpdG9yX2lkIjoiMTA0OTMwMzkyMTQ0MjQ5MDk3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf0ac2055d6ca7305b608984fdef557ae2e42a4e58887a11518f8434128e1c278
hovercard-subject-tagissue:185604832
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/12557/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7fab2e6a65f2320d77e3ee11b7f68433fcde46ccaea3cc89e2e3228a9bd41e28/angular/angular/issues/12557
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7fab2e6a65f2320d77e3ee11b7f68433fcde46ccaea3cc89e2e3228a9bd41e28/angular/angular/issues/12557
og:image:altI'm submitting a ... bug report => search github for a similar issue or PR before submitting feature request support request => Please do not submit support request here, instead see https://github...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:username0x-r4bbit
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/12557#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F12557
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F12557
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/12557
Reloadhttps://github.com/angular/angular/issues/12557
Reloadhttps://github.com/angular/angular/issues/12557
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests141 (141)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/12557
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/12557
Proposal: optional namespaces for inputs bindingshttps://github.com/angular/angular/issues/12557#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: inputs / outputshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20inputs%20%2F%20outputs%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
Backloghttps://github.com/angular/angular/milestone/82
https://github.com/0x-r4bbit
0x-r4bbithttps://github.com/0x-r4bbit
on Oct 27, 2016https://github.com/angular/angular/issues/12557#issue-185604832
https://github.com/angular/angular/blob/master/CONTRIBUTING.md#questionhttps://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
@cburgdorfhttps://github.com/cburgdorf
https://github.com/SanderElias
SanderEliashttps://github.com/SanderElias
on Oct 29, 2016https://github.com/angular/angular/issues/12557#issuecomment-257068708
@PascalPrechthttps://github.com/PascalPrecht
@inputshttps://github.com/inputs
vsavkinhttps://github.com/vsavkin
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
on Oct 31, 2016https://github.com/angular/angular/issues/12557#event-842377402
tboschhttps://github.com/tbosch
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
on Nov 4, 2016https://github.com/angular/angular/issues/12557#event-848293728
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular/milestone/82
on Jan 23, 2018https://github.com/angular/angular/issues/12557#event-1437647071
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
on Mar 10, 2020https://github.com/angular/angular/issues/12557#event-3115217084
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
core: inputs / outputshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20inputs%20%2F%20outputs%22
on Mar 10, 2020https://github.com/angular/angular/issues/12557#event-3115217720
angular-robothttps://github.com/apps/angular-robot
votes requiredhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22votes%20required%22
on Jun 4, 2021https://github.com/angular/angular/issues/12557#event-4843534528
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 4, 2021https://github.com/angular/angular/issues/12557#issuecomment-854774061
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
https://github.com/apps/angular-robot
angular-robothttps://github.com/apps/angular-robot
on Jun 24, 2021https://github.com/angular/angular/issues/12557#issuecomment-867662944
communityhttps://angular.io/resources?category=community
packagehttps://angular.io/guide/creating-libraries
documentationhttps://github.com/angular/angular/blob/e29eb8abfbfdfb793e08ac88e14b7ba6d2ff2136/docs/GITHUB_PROCESS.md#feature-request-process
angular-robothttps://github.com/apps/angular-robot
insufficient voteshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22insufficient%20votes%22
on Jun 24, 2021https://github.com/angular/angular/issues/12557#event-4934820858
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Jul 17, 2021https://github.com/angular/angular/issues/12557#issuecomment-881789591
alxhubhttps://github.com/alxhub
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 17, 2021https://github.com/angular/angular/issues/12557#event-5033299153
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Aug 17, 2021https://github.com/angular/angular/issues/12557#issuecomment-900433223
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Aug 17, 2021https://github.com/angular/angular/issues/12557#event-5169966847
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/12557
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/12557
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: inputs / outputshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20inputs%20%2F%20outputs%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22feature%22
freq2: mediumhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22freq2%3A%20medium%22
BacklogNo due datehttps://github.com/angular/angular/milestone/82
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.