question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convert hyphen-case to camelCase for Component/Directive properties

See original GitHub issue

Currently, 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:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mheverycommented, Aug 5, 2015

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 is myProperty 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 has myProperty not my-property.

Closing, working as intended.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 6, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found