Angular normalization note

It is suggested to use a standardized attribute naming convention in html, of all lower case with words separated by dashes. This can be seen in Bootstrap as an example:

"col-md-12", "btn-default", "my-form", "menu-bar"

Use this naming convention for attributes, classes, and ids.

Javascript (and Angular, since it is javascript) can’t use variable names like this because the ‘-‘ would be seen as a minus sign:

var col-md-12 = 3; //doesn't work because it of dashes

Angular uses camel casing:

colMd12
btnDefault
myForm
menuBar

And Angular will know to match a javascript variable of ‘myForm’ to a html attribute of ‘my-form’.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s