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

docs(template-syntax/structural-directives): refresh both guides #3110

Merged
merged 1 commit into from
Feb 7, 2017

Conversation

wardbell
Copy link
Contributor

@wardbell wardbell commented Jan 17, 2017

Refresh both guides for style, accuracy, understanding
Move details of structural directives from template-syntax to structural-directives guide
Add <ng-container> to structural-directives
Fix samples in both guides
Touch up glossary
Better conformance to google doc guidelines: we->you
closes #2303, #2885

Todo

  • Update template-syntax e2e tests [too few tests; none touched; revisit later]
  • Update structural-directives e2e tests

@wardbell wardbell force-pushed the docs-template-syntax-directives branch 20 times, most recently from 6c84ea9 to 4d72fdb Compare January 22, 2017 07:06
@wardbell wardbell changed the title [WIP] docs: template syntax refresh for style, accuracy, understanding [WIP] docs(template-syntax/structural-directives): refresh both guides Jan 22, 2017
@wardbell wardbell force-pushed the docs-template-syntax-directives branch 7 times, most recently from e9e48d6 to 080855a Compare January 23, 2017 05:18
@wardbell wardbell force-pushed the docs-template-syntax-directives branch 4 times, most recently from 04a374c to 5c41ab0 Compare January 23, 2017 08:17
@wardbell wardbell changed the title [WIP] docs(template-syntax/structural-directives): refresh both guides docs(template-syntax/structural-directives): refresh both guides Jan 23, 2017
Copy link
Contributor Author

@wardbell wardbell left a comment

Choose a reason for hiding this comment

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

K .I hope I've answered your questions to your satisfaction.

+makeExample('structural-directives/ts/app/app.component.html', 'inside-ngfor')(format=".")

:marked
This is manifestly more complicated than `ngIf` and rightly so.
`NgFor` directive has more features, both required and optional, than the `NgIf` shown in this guide.
The `ngFor` directive has more features, both required and optional, than the `NgIf` shown in this guide.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reversing. Talking about the directive class, not the selector name. The class has features. The selector does not. HTH.

@@ -305,6 +315,14 @@ a#microsyntax
The `NgFor` directive sets its _context's_ `$implicit` property to the current item in the list during each iteration.
That becomes the current value of the `hero` variable in the example above.

.alert.is-critical
:marked
Ward: I got lost on this third point. ^^ By context, do we mean the element that 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.

Let me try again and see if it helps.


The expression could call something like `getFoo()`. Only we know what `getFoo()` does.
If `getFoo()` changes something and we happen to be binding to that something, we risk an unpleasant experience. Angular may or may not display the changed value. Angular may detect the change and throw a warning error. Our general advice: stick to data properties and to methods that return values and do no more.
The expression could call something like `getFoo()`. Only directive know what `getFoo()` does.
Copy link
Contributor

@kapunahelewong kapunahelewong Jan 24, 2017

Choose a reason for hiding this comment

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

Possible missing word? Maybe "the"?

"Only directive know what getFoo() does."

The following couple of sentences use singular "directive" along with the plural of the verb in the same manner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh my! Some kind of search and replace changed "your" or "we" to "directive". Seems to have been limited to this location. Fixed it.

@@ -541,7 +601,7 @@ block dart-type-exceptions
:marked
### Remember the brackets
The brackets tell Angular to evaluate the template expression.
If we forget the brackets, Angular treats the string as a constant and *initializes the target property* with that string.
If directive forget the brackets, Angular treats the string as a constant and *initializes the target property* with that string.
Copy link
Contributor

Choose a reason for hiding this comment

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

"If the directive doesn't have the brackets" or something similar that fixes "directive forget"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about "if you omit the brackets"

I thought I fixed all the "we" to "you". Hmmm

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that was the first of a rogue find and replace that sprinkled "directive" in places "you" or "we" seems to have been. I think I changed all the rest of them. I just went back and changed this one and pushed up.

@kapunahelewong kapunahelewong force-pushed the docs-template-syntax-directives branch 2 times, most recently from 69e9428 to bdaf663 Compare January 25, 2017 20:11
@wardbell wardbell force-pushed the docs-template-syntax-directives branch 3 times, most recently from 1f0ad42 to 7643eca Compare February 7, 2017 02:30
…style, accuracy, understanding

Move details of structural directives from template-syntax to structural-directives guide
Add <ng-container> to structural-directives
Fix samples in both guides
Touch up glossary
Better conformance to google doc guidelines: we->you
closes angular#2303, angular#2885
@wardbell wardbell force-pushed the docs-template-syntax-directives branch from 7643eca to c70c894 Compare February 7, 2017 02:33
@wardbell wardbell merged commit f24b830 into angular:master Feb 7, 2017
@wardbell wardbell deleted the docs-template-syntax-directives branch February 7, 2017 03:06
abdel-ships-it pushed a commit to abdel-ships-it/angular.io that referenced this pull request Feb 11, 2017
…style, accuracy, understanding (angular#3110)

Move details of structural directives from template-syntax to structural-directives guide
Add <ng-container> to structural-directives
Fix samples in both guides
Touch up glossary
Better conformance to google doc guidelines: we->you
closes angular#2303, angular#2885
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.

[2.0] Drop <template [ngIf]=""> syntax from docs & examples
3 participants