Skip to content

Commit 3e1930f

Browse files
gkalpakpetebacondarwin
authored andcommitted
docs(tutorial/step_03): improve explanation of camel-/kebab-casing
Related to angular#15051.
1 parent c063df2 commit 3e1930f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docs/content/guide/directive.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Angular **normalizes** an element's tag and attribute name to determine which el
7070
directives. We typically refer to directives by their case-sensitive
7171
[camelCase](http://en.wikipedia.org/wiki/CamelCase) **normalized** name (e.g. `ngModel`).
7272
However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case
73-
forms, typically using [dash-delimited](http://en.wikipedia.org/wiki/Letter_case#Computers)
73+
forms, typically using [dash-delimited](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles)
7474
attributes on DOM elements (e.g. `ng-model`).
7575

7676
The **normalization** process is as follows:

docs/content/tutorial/step_03.ngdoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ To create a component, we use the {@link angular.Module#component .component()}
6868
{@link module Angular module}. We must provide the name of the component and the Component
6969
Definition Object (CDO for short).
7070

71-
Remember that (since components are also directives) the name of the component is in `camelCase`,
72-
but we will use `kebab-case`, when referring to it in our HTML.
71+
Remember that (since components are also directives) the name of the component is in `camelCase`
72+
(e.g. `myAwesomeComponent`), but we will use `kebab-case` (e.g. `my-awesome-component`) when
73+
referring to it in our HTML. (See [here][case-styles] for a description of different case styles.)
7374

7475
In its simplest form, the CDO will just contain a template and a controller. (We can actually omit
7576
the controller and Angular will create a dummy controller for us. This is useful for simple
@@ -276,6 +277,7 @@ files, so it remains easy to locate as our application grows.
276277
<ul doc-tutorial-nav="3"></ul>
277278

278279

280+
[case-styles]: https://en.wikipedia.org/wiki/Letter_case#Special_case_styles
279281
[jasmine-docs]: http://jasmine.github.io/2.4/introduction.html
280282
[jasmine-home]: http://jasmine.github.io/
281283
[karma]: https://karma-runner.github.io/

0 commit comments

Comments
 (0)