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

Conversation

joej164
Copy link
Contributor

@joej164 joej164 commented Nov 23, 2018

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Updates documentation to clarify the controller naming convention for first time users of angular.js

What is the current behavior? (You can also link to an open issue here)
Not as clear as it could be

What is the new behavior (if this is a feature change)?
Improved documentation

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Fix/Feature: Docs have been added/updated
  • Fix/Feature: Tests have been added; existing tests pass

Other information:
Due to me messing up my previous PR with a commit from a work account, i closed that PR and opened a new one. Please reference comments about that at the link below

#16740 (comment)

@@ -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.

@@ -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.

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

This looks better. We can squash the commits when we merge.

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

Thx, @joej164! I left a couple of minor comments.

@@ -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 tells AngularJS to instantiate a phoneList component here.
Copy link
Member

Choose a reason for hiding this comment

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

Since this is HTML, we should use HTML comments (<!-- ... -->).
I would also reduce the spacing (e.g. to 2 or 4 spaces).

@@ -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 name is what AngularJS uses to match to the <phone-list> element.
Copy link
Member

Choose a reason for hiding this comment

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

I would reduce the spacing (e.g. to 2 or 4 spaces).

<body>
<!-- The following line is how to use the greetUser angular.js component above in your html doc-->
<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.

docs/content/tutorial/step_03.ngdoc Show resolved Hide resolved
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

A few more to go 😇

@@ -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 --!>
Copy link
Member

Choose a reason for hiding this comment

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

Typo: --!> should be -->.
Can you also wrap phoneList in backticks and add a . at the end (for consistency)?

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

Stray dot before //.
Can you also wrap <phone-list> in backticks?

<body>
<!-- The following line is how to use the greetUser angular.js component above in your html doc-->
<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.

Still looks inconsistent to me 😁

@@ -88,6 +88,13 @@ Let's see an example:
});
```

```html
<body>
<!-- The following line is how to use the greetUser angular.js component above in your html doc-->
Copy link
Member

Choose a reason for hiding this comment

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

angular.js --> AngularJS (or just remove that altogether, since it should be clear by now that we are talking about AngularJS 😁)
Can you also wrap greetUser in backticks, add a . at the end and leave a space befoe the closing -->?

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, I think I got them all.

Sorry for the delay, every time I wanted to get to this over the weekend it kept slipping my mind.

One Issue i had was I wasn't sure how to render the files into final docs to see what I was doing. Is there a link to an article on how I could have rendered the page?

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

One last thing. LGTM otherwise.
Thx for following through, @joej164 👍

docs/content/tutorial/step_03.ngdoc Outdated Show resolved Hide resolved
```html
<body>
<!-- The following line is how to use the `greetUser` component above in your html doc. -->
`<greet-user></greet-user>`
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the backticks from around <greet-user></greet-user> here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did that also. Thanks for being patient.

@gkalpak gkalpak closed this in a0c4e25 Dec 5, 2018
@gkalpak
Copy link
Member

gkalpak commented Dec 5, 2018

Merged 🎉 Thx, @joej164 👍
(Note: While merging, I noticed the commit message did not follow our guidelines, so I tweaked it.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants