Title: ng-attr-* entry in `$attrs` has incorrect casing · Issue #16624 · angular/angular.js · GitHub
Open Graph Title: ng-attr-* entry in `$attrs` has incorrect casing · Issue #16624 · angular/angular.js
X Title: ng-attr-* entry in `$attrs` has incorrect casing · Issue #16624 · angular/angular.js
Description: I'm submitting a ... bug report Current behavior: The entries in $attrs created by ng-attr-* have the incorrect camel casing when the attribute has mixed case. Details Normally the keys in $attrs get normalized by directiveNormalize(name...
Open Graph Description: I'm submitting a ... bug report Current behavior: The entries in $attrs created by ng-attr-* have the incorrect camel casing when the attribute has mixed case. Details Normally the keys in $attrs g...
X Description: I'm submitting a ... bug report Current behavior: The entries in $attrs created by ng-attr-* have the incorrect camel casing when the attribute has mixed case. Details Normally the keys in $att...
Opengraph URL: https://github.com/angular/angular.js/issues/16624
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng-attr-* entry in `$attrs` has incorrect casing","articleBody":"**I'm submitting a ...**\r\n- [X] bug report\r\n\r\n**Current behavior:**\r\nThe entries in `$attrs` created by `ng-attr-*` have the incorrect camel casing when the attribute has mixed case.\r\n\r\n**Details**\r\nNormally the keys in `$attrs` get normalized by `directiveNormalize(name.toLowerCase())`: https://github.com/angular/angular.js/blob/v1.7.2/src/ng/compile.js#L2274\r\n\r\nBut for `ng-attr-*` the name gets [partially normalized](https://github.com/angular/angular.js/blob/v1.7.2/src/ng/compile.js#L2261-L2264) by the `ng-attr-*` logic before being [normalized again](https://github.com/angular/angular.js/blob/v1.7.2/src/ng/compile.js#L2274) in the standard way. I think this has existed since [mixed case attributes](https://github.com/angular/angular.js/commit/d8e37078600089839f82f0e84022f1087e1fd3f2#diff-a732922b631efed1b9f33a24082ae0dbR1423) were supported.\r\n\r\nThis causes things like `ng-attr-my-camel_prop=\"...\"` to be `$attrs.myCamelprop` instead of `$attrs.myCamelProp`. Where `my-camel_prop=\"...\"` would be `$attrs.myCamelProp`.\r\n\r\nNote that the actual attribute put onto the element is correct, it's only the entry in `$attrs` and `$attrs.$attr` that have the incorrect casing. For example `ng-attr-my-camel_case` correctly maps to the `my-camelCase` attribute, its just the key in `$attrs.myCamelcase` and `$attrs.$attr.myCamelcase` that are wrong.\r\n\r\n**Expected / new behavior:**\r\nConsistent attribute name normalizing between `ng-attr-*` and normal attributes.\r\n\r\n**Anything else:**\r\nI wonder if `$attrs.$set` has any issues? https://github.com/angular/angular.js/blob/v1.7.2/src/ng/compile.js#L1762-L1765","author":{"url":"https://github.com/jbedard","@type":"Person","name":"jbedard"},"datePublished":"2018-07-06T03:22:21Z","url":"https://github.com/angular/angular.js/issues/16624"}
| 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:556e5a05-28f3-e9fa-666f-f265e0873074 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AFBC:AB571:2BD295:3F7284:6AFD7AC5 |
| html-safe-nonce | 88157497780cc36f9b6e961244bc372fe6b9ff25e81a5cb8be8a2889c1b85e10 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRkJDOkFCNTcxOjJCRDI5NTozRjcyODQ6NkFGRDdBQzUiLCJ2aXNpdG9yX2lkIjoiNzU0NDUzMTQ4ODAwMDAxNTA0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4df0b7fea9d20949fb929ee365a1a75ed74bcb2315af01c224351e89f7d355fd |
| hovercard-subject-tag | issue:338792237 |
| 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.js/16624/issue_layout |
| twitter:image | https://opengraph.githubassets.com/491aed04a80bf779a3a6f8ae6264232571426c96ccd47e88f648a0ea5b1476fc/angular/angular.js/issues/16624 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/491aed04a80bf779a3a6f8ae6264232571426c96ccd47e88f648a0ea5b1476fc/angular/angular.js/issues/16624 |
| og:image:alt | I'm submitting a ... bug report Current behavior: The entries in $attrs created by ng-attr-* have the incorrect camel casing when the attribute has mixed case. Details Normally the keys in $attrs g... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jbedard |
| hostname | github.com |
| expected-hostname | github.com |
| None | 544ff6b59bd215c4609120f6e334dbd0b00d34fb6f8bc03a476f72256998887e |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular.js git https://github.com/angular/angular.js.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 460078 |
| octolytics-dimension-repository_nwo | angular/angular.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 460078 |
| octolytics-dimension-repository_network_root_nwo | angular/angular.js |
| 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 | 71c92f8b27ec5e9aa6f6477b4e067a4727fc9edb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width