What is meant by CamelCase in AngularJS?

1.3k views Asked by At

I am a beginner in AngularJS. While reading an article about Custom Directive, I have seen a word 'CAMEL CASE'. What exactly it means?

This is the paragraph in which I have seen about CAMEL CASE:

While matching directives, Angular strips the prefix x- or data- from element/attribute names. Then it converts - or : delimited strings to camelCase and matches with the registered directives. That’s why we have used the helloWorld directive as hello-world in the HTML.

5

There are 5 answers

0
display name On

camelCase means a string composed from multiple words together and each word has its first letter capitalized.

0
Maksim Satsikau On

The term is not really specific to angular or any other language. It's a general naming convention where you start your variable names with lower case, and then continue with upper case for any subsequent word making up the variable name.

The name camel case comes from the joking notion that capitalized letters looks like camel humps

1
Naumann On

ThisNameIsCamelCase

this-name-is-not

0
31piy On

Camel case is a type of convention used in many of the programming languages, e.g. Java. Since the programming languages separate two words separated by space differently, there should be some way to write a keyword with multiple words.

Take a word software architect for example. In camel case, first letter of each word is capitalized. So this term will be written as SoftwareArchitect (or softwareArchitect).

There are many others in the world. There is a good read on Wikipedia about these conventions.

0
Prasad Sonawane On
  • It is the style guidelines for programming language.

  • refers the spaces indentation and naming conventions improve code readability and make maintenance easier.

  • In angular . Ex. Controller, service, directive, filter naming convention also refers the CamelCase rules.