Convert hyphen-case to camelCase for Component/Directive properties
See original GitHub issueCurrently, specifying a property in camel case like myProperty
works with attributes written with hyphens (like my-property
). This conversion should (also) work the other way, as it is more intuitive to list the properties in the Component with the exact strings by which they’ll be accessed from the template.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Convert hyphens to camel case (camelCase) - Stack Overflow
Try this: var camelCased = myString.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });. The regular expression will match the -i in ...
Read more >How to convert hyphens to camel case in JavaScript
Store the string containing hyphens into variable. Then use the RegExp to replace the hyphens and make the first letter of words as...
Read more >Convert a String to Camel Case - Baeldung
In this tutorial, we'll focus on conversion to lower camel case, though these techniques are easily adapted to suit either. 2.1. Regular ...
Read more >dash-case - npm search
npm library that it converts dash/underscore delimited words into camel casing.(known as Upper Camel Case, also often referred to as Pascal case).
Read more >TitleCase - Text Conversion Solutions
Convert text to Title Case, UPPERCASE, lowercase, CamelCase, Pascal Case, Start Case, snake_case, hyphen-case, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am against changing this. The
properties
annotation list property name. We currently use HTML for template which is case insensitive, but other systems such us NativeScript or ReactNative are case sensitive. The dash-case is what we do with dealing with HTML case insensitive, and the problem goes away if we use different rendering. To bring the HTML limitation into the rest of the framework would not make sense for non-HTML renderers. The mental model is that the property ismyProperty
as that is the name on the object. The fact that HTML is case insensitive is HTML problem and should not pollute the rest. Declaring class hasmyProperty
notmy-property
.Closing, working as intended.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.