Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(Displaying Data): copy edits #2435

Merged
merged 3 commits into from
Sep 23, 2016

Conversation

kapunahelewong
Copy link
Contributor

Copy edits in guide/_data.json and displaying-data.jade.

@@ -17,7 +17,7 @@

"displaying-data": {
"title": "Displaying Data",
"intro": "Interpolation and other forms of property binding help us show app data in the UI.",
"intro": "Property binding shows app data in the UI.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm... I wouldn't say the binding shows it, it just enables showing it. Can you reword this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to: "Property binding helps show app data in the UI."

:marked
We typically display data in Angular by binding controls in an HTML template
Angular typically displays data by binding controls in an HTML template
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes the meaning. The dev specifies the binding, which enables the app to display property values. Can you think of another way to say this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -17,42 +17,42 @@ figure.image-display
img(src="/resources/images/devguide/displaying-data/final.png" alt="Final UI")

:marked
# Table Of Contents
# Contents
Copy link
Contributor

@kwalrath kwalrath Sep 21, 2016

Choose a reason for hiding this comment

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

Do we usually use a first-level heading for Contents? (I'm actually not sure. I tend not to in my own writing, but I don't remember whether we've established a good precedent in these pages.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I did a global search and found that in readme files we tend toward ## but in the jade files we use #. I'll keep an eye out for consistency.

much more readable HTML.
The backtick (<code>\`</code>)&mdash;which is *not* the same character as a single
quote (`'`)&mdash;allows you to compose a string over several lines, which makes
HTML more readable.
Copy link
Contributor

Choose a reason for hiding this comment

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

HTML -> the HTML
?
(It sounded funny 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.

Done.

the view such as a keystroke, a timer completion, or an async `XHR` response.
We don't have those in this sample.
But then the properties aren't changing on their own either. For the moment we must operate on faith.
the view, such as a keystroke, a timer completion, or an async `XHR` response.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is XHR in code font? I don't think it's a string you'll see in any code. Also, you already said "asynchronous" before, so "async" seems unnecessary. Maybe:

...a response to an HTTP request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

This is a wonderfully concise and compact technique.

Some folks prefer to declare the properties and initialize them within a constructor like this:
You initialized your component properties using variable assignment. You could have
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not crazy about "you" here, since they didn't make the decision. Can you think of a better way to phrase this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

That's fine too. The choice is a matter of taste and organization policy.
We'll adopt the more terse "variable assignment" style in this chapter simply because
there will be less code to read.
This page demonstrates the more terse "variable assignment" style simply for
Copy link
Contributor

@kwalrath kwalrath Sep 21, 2016

Choose a reason for hiding this comment

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

Ward mentioned using "chapter" instead of "page" because "page" can be confused with the app. This is the first time I've noticed that problem, although I don't think it matters too much in this case which one you mean. Maybe:

This app uses the more terse...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Changed.

each item in the `heroes` list.

+makeExcerpt('app/app.component.2.ts', 'template')

:marked
Our presentation is the familiar HTML unordered list with `<ul>` and `<li>` tags. Let's focus on the `<li>` tag.
This presentation uses the HTML unordered list with `<ul>` and `<li>` tags. The `*ngFor`
Copy link
Contributor

Choose a reason for hiding this comment

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

presentation -> UI
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. Done.

it is an example of a [template input variable](./template-syntax.html#ngForMicrosyntax).
it is an example of a template input variable. Read
more about template input variables in the [microsyntax](./template-syntax.html#ngForMicrosyntax) section of
the [Template Syntax](./template-syntax.html) page.
Copy link
Contributor

Choose a reason for hiding this comment

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

good x-ref!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! That one took me a minute to sort out. :)

We are defining our data directly inside our component.
That's fine for a demo but certainly isn't a best practice. It's not even a good practice.
Although we won't do anything about that in this chapter, we'll make a mental note to fix this down the road.
You are defining your data directly inside the component which isn't best practice.
Copy link
Contributor

Choose a reason for hiding this comment

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

which -> , which

(as a rule, use either "that" or ", which", depending on whether the phrase is restrictive—can't be dropped without changing the meaning—or nonrestrictive)

Copy link
Contributor

Choose a reason for hiding this comment

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

"you" sounds a little accusatory here. Maybe:

This app's code defines the data directly inside the component, which...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

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

You input the editor's changes well, but I think we need to use "you" much less often. Also, in many cases the editor changed intros to something that looked like a command.

That's fine for a demo but certainly isn't a best practice. It's not even a good practice.
Although we won't do anything about that in this chapter, we'll make a mental note to fix this down the road.
You are defining your data directly inside the component which isn't best practice.
For illustrative purposes, however, it's fine.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure that "illustrative purposes" is the best phrase here. Maybe... "a simple demo"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

most of the time we're binding to more specialized objects.

Let's turn our !{_array} of hero names into !{_an} !{_array} of `Hero` objects. For that we'll need a `Hero` class.
At the moment, you're binding to !{_an} !{_array} of strings.
Copy link
Contributor

@kwalrath kwalrath Sep 21, 2016

Choose a reason for hiding this comment

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

Again, the "you" seems unnecessary here. Maybe:

you're binding -> the data binding is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Let's turn our !{_array} of hero names into !{_an} !{_array} of `Hero` objects. For that we'll need a `Hero` class.
At the moment, you're binding to !{_an} !{_array} of strings.
Most of the time you'd bind to more specialized objects. To do this, turn your !{_array}
Copy link
Contributor

Choose a reason for hiding this comment

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

Most of the time you'd bind to
->
In real applications, most bindings are to

To do this, ...
->
(new paragraph)
To convert this binding to use specialized objects,
turn the !{_array}...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


It might not look like we have properties, but we do. We're taking
advantage of a TypeScript shortcut in our declaration of the constructor parameters.
It might not look like you have properties, but you do. You're taking
Copy link
Contributor

@kwalrath kwalrath Sep 21, 2016

Choose a reason for hiding this comment

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

Let's do more de-you-ification:

you have -> the class has
you do -> it does

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

It might not look like we have properties, but we do. We're taking
advantage of a TypeScript shortcut in our declaration of the constructor parameters.
It might not look like you have properties, but you do. You're taking
advantage of a TypeScript shortcut in your declaration of the constructor parameters.
Copy link
Contributor

@kwalrath kwalrath Sep 21, 2016

Choose a reason for hiding this comment

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

Change this last sentence to avoid the "your":

The declaration ... parameters takes advantage of ... shortcut.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

At the moment it displays the hero's `id` and `name`.
Let's fix that so we display only the hero's `name` property.
Fix that so you display only the hero's `name` property.
Copy link
Contributor

Choose a reason for hiding this comment

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

so you -> to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


+makeExcerpt('app/app.component.3.ts', 'template')

:marked
Our display looks the same, but now we know much better what a hero really is.
Your display looks the same, but now you've clarified what a hero is.
Copy link
Contributor

Choose a reason for hiding this comment

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

Your -> The
now you've clarified ... is -> the code is clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


.l-main-section#ngIf
:marked
## Conditional display with NgIf

Sometimes an app needs to display a view or a portion of a view only under specific circumstances.

In our example, we'd like to display a message if we have a large number of heroes, say, more than 3.
In the example, you can display a message if there are more than three heroes.
Copy link
Contributor

Choose a reason for hiding this comment

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

"you can" seems misleading here. The point is not what you can do, but that you're going to do it conditionally. Maybe:

Let's change the example to display...

(I know, that uses "us", but I can't think of a clearer way to introduce what's coming next. Maybe you can!)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confession...I love "let's"! :D
Done.

That hardly matters here. But it would matter a great deal, from a performance perspective, if
we were conditionally including or excluding a big chunk of HTML with many data bindings.
Angular isn't showing and hiding the message. It is adding and removing the paragraph element from the DOM
which improves performance, especially in larger projects when conditionally including or excluding
Copy link
Contributor

Choose a reason for hiding this comment

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

DOM which -> DOM. That

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Here's our final code:
Here's your final code:
Copy link
Contributor

Choose a reason for hiding this comment

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

your -> the

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'll be on the lookout for this same opportunity throughout. Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@kwalrath kwalrath left a comment

Choose a reason for hiding this comment

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

One tiny word went missing, but otherwise looks great!

The app's code defines the data directly inside the component, which isn't best practice.
In a simple demo, however, it's fine.

At the moment, the binding is !{_an} !{_array} of strings.
Copy link
Contributor

Choose a reason for hiding this comment

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

is -> is to

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@kwalrath kwalrath merged commit 6c7f330 into angular:master Sep 23, 2016
@kwalrath kwalrath deleted the kwong-display-data branch September 23, 2016 23:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants