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

docs(structural-directives): copyedits and some tweaks to code #3345

Merged

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Mar 5, 2017

  • Fix variable name li --> i
  • a --> an UnlessDirective
  • Jade had both #ngswitch and #ngSwitch as link targets;
    fixed to use same capitalization as template syntax page.
  • Drop "scrap.txt" file
  • Fixed broke fragment target (was missing #)
  • app/ --> src/app/ in prose summary
  • Other copy edits

@chalin chalin force-pushed the chalin-struct-directives-copyedits-0304 branch from 6a35f55 to cb4726e Compare March 7, 2017 18:29
Copy link
Contributor

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

I like the substantive changes. I added a very few more for you to add. Thanks!

As noted, we should not bother with makeExample -> makeExcerpt because we're converting this anyway. I'll accept it in this PR but not in future PRs because it wastes our time.

However, I can't accept the changes that move the anchors onto the end of l-main-section. I want anchors on their own lines as a#..., exactly as I had them.
Please revert those particular changes.

Then I'm happy to approve and merge.

<input type="radio" name="heroes" [(ngModel)]="hero" [value]="h">{{h.name}}
</label>
</ng-container>
<label *ngFor="let h of heroes">
Copy link
Contributor

Choose a reason for hiding this comment

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

Moving the ngFor to the label makes a lot of sense and we should do it UNLESS this is an example of <ng-container>. If it is, please restore. If it isn't, then your change is an improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not an example of <ng-container>. This code is not shown in the page, it is only there to support the ngSwitch code which is shown in the page.

@@ -1,21 +0,0 @@
// interesting but unused code
Copy link
Contributor

Choose a reason for hiding this comment

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

Please restore. This is harmless and I wanted to keep it around as an idea that I had. Sure, I'll probably forget all about it (I already did). But humor 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. (I thought that this file showed up in the plnkr and zip, but I just checked and it doesn't.)

- [The &lt;template> element](#template)
- [Write a structural directive](#unless)

Try the <live-example></live-example>.

a#definition
.l-main-section
.l-main-section#definition
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't "fix" these. I've created separate anchors on purpose, even where the header text would match the anchor name. I break fewer links this way and don't have to worry about what happens when I change a heading. I can also quickly find something when editing. So these kinds of changes actually make my life harder.

Most importantly, we're converting to pure markdown in v.2 and this makes it harder to figure out what's going on.

TAKE AWAY: Please revert them all and do not make further changes to structure/layout that have no visual effect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All reverted.

do not make further changes to structure/layout that have no visual effect

Ok.

+makeExample('structural-directives/ts/src/app/app.component.html', 'ngif')(format=".")
An asterisk (*) precedes the directive attribute name as in this example.

+makeExcerpt('src/app/app.component.html', 'ngif', '')
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is shorter and might be worth while if we were staying with Jade.. But we're converting all of this anyway and this kind of move is more of a distraction than a help right now.

I'll accept in THIS PR but please don't do this on future PRs.

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


:marked
* The `*ngIf` directive moved to the `<template>` tag where it became a property binding,`[ngIf]`.
* The rest of the `<div>`, including its class attribute, moved inside the `<template>` tag.
* The `*ngIf` directive moved to the `<template>` element where it became a property binding,`[ngIf]`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: all <template> will become <ng-template> in Angular v.4. I have to think about what this does to what we've been saying here.

@@ -436,49 +456,50 @@ a#template
It is never displayed directly.
In fact, before rendering the view, Angular _replaces_ the `<template>` and its contents with a comment.

If there is no structural directive, if you merely wrap some elements in a `<template>` and do nothing with it,
If there is no structural directive, and you merely wrap some elements in a `<template>` and do nothing with it,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ugh. I think the following is better ... we don't need to say "and do nothing with it"

If there is no structural directive and you merely wrap some elements in a <template>, those elements disappear.

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 structural directives manipulate HTML layout.
* to use [`<ng-container>`](#ngcontainer) as a grouping element when there is no suitable host element.
* that the angular "de-sugars" [asterisk (\*) syntax](#asterisk) into a `<template>`.
* that the angular "de-sugars" [asterisk (*) syntax](#asterisk) into a `<template>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix as:

that Angular "de-sugars" 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.

Done.
Also, I dropped the hyphen in "desugars" (Kathy confirmed a few days ago that there shouldn't be any hyphen).

@chalin chalin force-pushed the chalin-struct-directives-copyedits-0304 branch from cb4726e to c5f37b8 Compare March 9, 2017 15:48
@chalin
Copy link
Contributor Author

chalin commented Mar 9, 2017

All points addressed. And I've noted not to edit the +makeEx* mixin applications anymore (well, that means for the two files I have left to review :).

@chalin chalin closed this Mar 9, 2017
@chalin chalin reopened this Mar 9, 2017
- Fix variable name `li` --> `i`
- a --> an `UnlessDirective`
- Jade had both #ngswitch and #ngSwitch as link targets;
fixed to use same capitalization as template syntax page.
- Fixed broke fragment target (was missing #)
- Other copy edits and post-review comments from @wardbell
@chalin chalin force-pushed the chalin-struct-directives-copyedits-0304 branch from c5f37b8 to fc256f6 Compare March 9, 2017 22:09
@chalin
Copy link
Contributor Author

chalin commented Mar 9, 2017

@wardbell @kapunahelewong - the Structural Directives page currently has (essentially) this Table of Contents:

  • What are structural directives?
  • NgIf
  • Group sibling elements with <ng-container>
  • NgFor
  • NgSwitch*
  • <template>
  • Write your own directive

I think it would improve the flow if we covered all the structural directives first (since that is the purpose of this guide), before mentioning <ng-container>.

I'd like to suggest that we move the <ng-container> section like so:

  • What are structural directives?
  • NgIf
  • NgFor
  • NgSwitch*
  • <template>
  • Group sibling elements with <ng-container> <======
  • Write your own directive

I can do it in this PR if you agree.

@wardbell
Copy link
Contributor

As noted in Slack, I'd like to get this PR in and then let Kapunahele and you work out the TOC question in a followup PR.

@wardbell wardbell merged commit 7d17e34 into angular:master Mar 10, 2017
@wardbell wardbell deleted the chalin-struct-directives-copyedits-0304 branch March 10, 2017 01:30
chalin added a commit to IdeaBlade/angular.io that referenced this pull request Mar 10, 2017
This is a follow-up to
angular#3345 (comment).

No changes were done to the `<ng-container>` section prose.

@wardbell: @kapunahelewong and I discussed this, and she agrees with
the change -- other edits will come in another PR.
wardbell pushed a commit that referenced this pull request Mar 11, 2017
…3367)

* docs(structural-directives): move ng-container section later in page
See #3345 (comment).
No changes were done to the `<ng-container>` section prose.
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