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

Commit 7643eca

Browse files
committed
docs(template-syntax/structural-directives): refresh both guides
Also describe <ng-content>
1 parent dc52c5e commit 7643eca

30 files changed

+207
-785
lines changed

public/docs/_examples/ngcontainer/ts/app/app.component.html renamed to public/docs/_examples/ngcontainer/ts/src/app/app.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ <h4>#1 &lt;ng-container&gt; and &lt;options&gt;</h4>
126126

127127
<p><i>&lt;select&gt; with &lt;span&gt;</i></p>
128128
<div>
129-
Pick your favorite hero, who is
130-
<label><input type="checkbox" checked (change)="showSad=!showSad">not sad</label>
129+
Pick your favorite hero
130+
(<label><input type="checkbox" checked (change)="showSad=!showSad">show sad</label>)
131131
</div>
132132
<!-- #docregion select-span -->
133133
<select [(ngModel)]="hero">
@@ -141,8 +141,8 @@ <h4>#1 &lt;ng-container&gt; and &lt;options&gt;</h4>
141141

142142
<p><i>&lt;select&gt; with &lt;ng-container&gt;</i></p>
143143
<div>
144-
Pick your favorite hero, who is
145-
<label><input type="checkbox" checked (change)="showSad=!showSad">not sad</label>
144+
Pick your favorite hero
145+
(<label><input type="checkbox" checked (change)="showSad=!showSad">show sad</label>)
146146
</div>
147147
<!-- #docregion select-ngcontainer -->
148148
<select [(ngModel)]="hero">

public/docs/_examples/ngcontainer/ts/app/app.module.ts renamed to public/docs/_examples/ngcontainer/ts/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import { BrowserModule } from '@angular/platform-browser';
55

66
import { AppComponent } from './app.component';
77
import { ContentComponent } from './content.component';
8+
import { heroComponents } from './hero.components';
89

910
@NgModule({
1011
imports: [ BrowserModule, FormsModule ],
1112
declarations: [
1213
AppComponent,
13-
ContentComponent
14+
ContentComponent,
15+
heroComponents
1416
],
1517
bootstrap: [ AppComponent ]
1618
})

public/docs/_examples/ngcontainer/ts/app/hero.ts renamed to public/docs/_examples/ngcontainer/ts/src/app/hero.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Hero {
55
emotion?: string;
66
}
77

8-
export const heroes = [
8+
export const heroes: Hero[] = [
99
{ id: 1, name: 'Mr. Nice', emotion: 'happy'},
1010
{ id: 2, name: 'Narco', emotion: 'sad' },
1111
{ id: 3, name: 'Windstorm', emotion: 'confused' },

public/docs/_examples/ngcontainer/ts/index.html renamed to public/docs/_examples/ngcontainer/ts/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1">
88
<link rel="stylesheet" href="styles.css">
99

10-
<!-- Polyfills for older browsers -->
10+
<!-- Polyfills -->
1111
<script src="node_modules/core-js/client/shim.min.js"></script>
1212

1313
<script src="node_modules/zone.js/dist/zone.js"></script>
1414
<script src="node_modules/systemjs/dist/system.src.js"></script>
1515

1616
<script src="systemjs.config.js"></script>
1717
<script>
18-
System.import('app').catch(function(err){ console.error(err); });
18+
System.import('main.js').catch(function(err){ console.error(err); });
1919
</script>
2020
</head>
2121

Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// #docregion
22
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3-
import { AppModule } from './app.module';
3+
import { AppModule } from './app/app.module';
44

55
platformBrowserDynamic().bootstrapModule(AppModule);
66

public/docs/_examples/structural-directives/ts/app/my-unless.directive.ts

Lines changed: 0 additions & 55 deletions
This file was deleted.

public/docs/_examples/structural-directives/ts/app/app.component.html renamed to public/docs/_examples/structural-directives/ts/src/app/app.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ <h4>*ngIf with a &lt;ng-container&gt;</h4>
9090
<p><i>&lt;select&gt; with &lt;span&gt;</i></p>
9191
<!-- #docregion select-span -->
9292
<div>
93-
Pick your favorite hero, who is
94-
<label><input type="checkbox" checked (change)="showSad = !showSad">not sad</label>
93+
Pick your favorite hero
94+
(<label><input type="checkbox" checked (change)="showSad = !showSad">show sad</label>)
9595
</div>
9696
<select [(ngModel)]="hero">
9797
<span *ngFor="let h of heroes">
@@ -105,8 +105,8 @@ <h4>*ngIf with a &lt;ng-container&gt;</h4>
105105
<p><i>&lt;select&gt; with &lt;ng-container&gt;</i></p>
106106
<!-- #docregion select-ngcontainer -->
107107
<div>
108-
Pick your favorite hero, who is
109-
<label><input type="checkbox" checked (change)="showSad = !showSad">not sad</label>
108+
Pick your favorite hero
109+
(<label><input type="checkbox" checked (change)="showSad = !showSad">show sad</label>)
110110
</div>
111111
<select [(ngModel)]="hero">
112112
<ng-container *ngFor="let h of heroes">
@@ -212,7 +212,7 @@ <h2>&lt;template&gt;</h2>
212212

213213
<hr>
214214

215-
<h2 id="myUnless">[myUnless]</h2>
215+
<h2 id="myUnless">UnlessDirective</h2>
216216
<p>
217217
The condition is currently
218218
<span [ngClass]="{ a: !condition, b: condition, unless: true }">{{condition}}</span>.
@@ -234,7 +234,7 @@ <h2 id="myUnless">[myUnless]</h2>
234234
<!-- #enddocregion myUnless-->
235235

236236

237-
<h4>MyUnlessDirective with template</h4>
237+
<h4>UnlessDirective with template</h4>
238238

239239
<!-- #docregion myUnless-1 -->
240240
<p *myUnless="condition">Show this sentence unless the condition is true.</p>

public/docs/_examples/structural-directives/ts/src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { BrowserModule } from '@angular/platform-browser';
55

66
import { AppComponent } from './app.component';
77
import { heroSwitchComponents } from './hero-switch.components';
8-
import { MyUnlessDirective } from './my-unless.directive';
8+
import { UnlessDirective } from './unless.directive';
99

1010
@NgModule({
1111
imports: [ BrowserModule, FormsModule ],
1212
declarations: [
1313
AppComponent,
1414
heroSwitchComponents,
15-
MyUnlessDirective
15+
UnlessDirective
1616
],
1717
bootstrap: [ AppComponent ]
1818
})

public/docs/_examples/structural-directives/ts/src/app/heavy-loader.component.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

public/docs/_examples/structural-directives/ts/app/hero.ts renamed to public/docs/_examples/structural-directives/ts/src/app/hero.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Hero {
55
emotion?: string;
66
}
77

8-
export const heroes = [
8+
export const heroes: Hero[] = [
99
{ id: 1, name: 'Mr. Nice', emotion: 'happy'},
1010
{ id: 2, name: 'Narco', emotion: 'sad' },
1111
{ id: 3, name: 'Windstorm', emotion: 'confused' },

public/docs/_examples/structural-directives/ts/src/app/structural-directives.component.html

Lines changed: 0 additions & 109 deletions
This file was deleted.

public/docs/_examples/structural-directives/ts/src/app/structural-directives.component.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)