Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 7981140

Browse files
joej164gkalpak
authored andcommitted
docs(tutorial/step_3): clarify how components are mapped to HTML elements
Closes #16768
1 parent 838dd12 commit 7981140

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/content/tutorial/step_03.ngdoc

+9-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ Let's see an example:
8888
});
8989
```
9090

91+
```html
92+
<body>
93+
<!-- The following line is how to use the `greetUser` component above in your html doc. -->
94+
<greet-user></greet-user>
95+
</body>
96+
```
97+
9198
Now, every time we include `<greet-user></greet-user>` in our view, AngularJS will expand it into a
9299
DOM sub-tree constructed using the provided `template` and managed by an instance of the specified
93100
controller.
@@ -127,7 +134,7 @@ acquired skill.
127134
<body>
128135

129136
<!-- Use a custom component to render a list of phones -->
130-
<phone-list></phone-list>
137+
<phone-list></phone-list> <!-- This tells AngularJS to instantiate a `phoneList` component here. -->
131138

132139
</body>
133140
</html>
@@ -148,7 +155,7 @@ angular.module('phonecatApp', []);
148155
// Register `phoneList` component, along with its associated controller and template
149156
angular.
150157
module('phonecatApp').
151-
component('phoneList', {
158+
component('phoneList', { // This name is what AngularJS uses to match to the `<phone-list>` element.
152159
template:
153160
'<ul>' +
154161
'<li ng-repeat="phone in $ctrl.phones">' +

0 commit comments

Comments
 (0)