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

Update step_03.ngdoc to clarify #16768

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions docs/content/tutorial/step_03.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ Let's see an example:
});
```

```html
<html ng-app="myApp">
<head>
<script src="bower_components/angular/angular.js"></script>
<script src="app.js"></script>
</head>
<body>
<!-- The following line is how to use the greetUser angular.js controller/directive above in your html doc-->
joej164 marked this conversation as resolved.
Show resolved Hide resolved
<greet-user></greet-user>
</body>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent indentation is the lines above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks for catching that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looks inconsistent to me 😁

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, finally got this one. I was looking at the content of the body tag, not the tag itself. Think I finally got it.

</html>
```
joej164 marked this conversation as resolved.
Show resolved Hide resolved

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 +140,7 @@ acquired skill.
<body>

<!-- Use a custom component to render a list of phones -->
<phone-list></phone-list>
<phone-list></phone-list> // This is what calls the phoneList angular.js component
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Calls" is not really the right term here. How about:

This tells AngularJS to instantiate a phoneList component here.


</body>
</html>
Expand All @@ -148,7 +161,7 @@ angular.module('phonecatApp', []);
// Register `phoneList` component, along with its associated controller and template
angular.
module('phonecatApp').
component('phoneList', {
component('phoneList', { // This is what defines the html element <phone-list>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This name is what AngularJS uses to match to the <phone-list> element.

template:
'<ul>' +
'<li ng-repeat="phone in $ctrl.phones">' +
Expand Down