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
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ <h2 id="ngIf">NgIf</h2>

<!-- #docregion display-none -->
<p [style.display]="'block'">
Expression sets display to "block"" .
Expression sets display to "block".
This paragraph is visible.
</p>
<p [style.display]="'none'">
Expression sets display to "none" .
Expression sets display to "none".
This paragraph is hidden but still in the DOM.
</p>
<!-- #enddocregion display-none -->
Expand Down Expand Up @@ -152,11 +152,9 @@ <h2 id="ngSwitch">NgSwitch</h2>

<div>Pick your favorite hero</div>
<p>
<ng-container *ngFor="let h of heroes">
<label>
<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.

<input type="radio" name="heroes" [(ngModel)]="hero" [value]="h">{{h.name}}
</label>
<label><input type="radio" name="heroes" (click)="hero = null">None of the above</label>
</p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// #docplaster
// #docregion
// #docregion no-docs
// #docregion skeleton
// #docregion no-docs, skeleton
import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';

// #enddocregion skeleton
Expand All @@ -18,7 +17,7 @@ import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
* </div>
*
* ### Syntax
* *
*
* - `<div *myUnless="condition">...</div>`
* - `<div template="myUnless condition">...</div>`
* - `<template [myUnless]="condition"><div>...</div></template>`
Expand Down Expand Up @@ -50,6 +49,3 @@ export class UnlessDirective {
// #enddocregion set
// #docregion skeleton
}
// #enddocregion skeleton
// #enddocregion no-docs
// #enddocregion
2 changes: 1 addition & 1 deletion public/docs/ts/latest/guide/displaying-data.jade
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ figure.image-display
:marked
Notice the `hero` in the `ngFor` double-quoted instruction;
it is an example of a template input variable. Read
more about template input variables in the [microsyntax](./template-syntax.html#ngForMicrosyntax) section of
more about template input variables in the [microsyntax](./template-syntax.html#microsyntax) section of
the [Template Syntax](./template-syntax.html) page.

Angular duplicates the `<li>` for each item in the list, setting the `hero` variable
Expand Down
Loading