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

Commit

Permalink
docs(tutorial/step_3): clarify how components are mapped to HTML elem…
Browse files Browse the repository at this point in the history
…ents

Closes #16768
  • Loading branch information
joej164 authored and gkalpak committed Dec 5, 2018
1 parent 838dd12 commit 7981140
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/content/tutorial/step_03.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ Let's see an example:
});
```

```html
<body>
<!-- The following line is how to use the `greetUser` component above in your html doc. -->
<greet-user></greet-user>
</body>
```

Now, every time we include `<greet-user></greet-user>` in our view, AngularJS will expand it into a
DOM sub-tree constructed using the provided `template` and managed by an instance of the specified
controller.
Expand Down Expand Up @@ -127,7 +134,7 @@ acquired skill.
<body>

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

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

0 comments on commit 7981140

Please sign in to comment.