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

Commit 5357238

Browse files
committed
docs(toh-3): heavy copy edit; my-hero-detail -> hero-detail
1 parent 0e9da9f commit 5357238

21 files changed

+211
-173
lines changed

public/docs/_examples/toh-2/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ function getPageElts() {
128128
return {
129129
heroes: element.all(by.css('my-app li')),
130130
selected: element(by.css('my-app li.selected')),
131-
heroDetail: element(by.css('my-app > div, my-app > my-hero-detail > div'))
131+
heroDetail: element(by.css('my-app > div, my-app > hero-detail > div'))
132132
};
133133
}

public/docs/_examples/toh-3/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ function getPageElts() {
128128
return {
129129
heroes: element.all(by.css('my-app li')),
130130
selected: element(by.css('my-app li.selected')),
131-
heroDetail: element(by.css('my-app > div, my-app > my-hero-detail > div'))
131+
heroDetail: element(by.css('my-app > div, my-app > hero-detail > div'))
132132
};
133133
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<h1>{{title}}</h1>
2+
<h2>My Heroes</h2>
3+
<ul class="heroes">
4+
<li *ngFor="let hero of heroes"
5+
[class.selected]="hero === selectedHero"
6+
(click)="onSelect(hero)">
7+
<span class="badge">{{hero.id}}</span> {{hero.name}}
8+
</li>
9+
</ul>
10+
<!-- #docregion hero-detail-binding -->
11+
<hero-detail [hero]="selectedHero"></hero-detail>
12+
<!-- #enddocregion hero-detail-binding -->

public/docs/_examples/toh-3/ts/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const HEROES: Hero[] = [
3131
<span class="badge">{{hero.id}}</span> {{hero.name}}
3232
</li>
3333
</ul>
34-
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
34+
<hero-detail [hero]="selectedHero"></hero-detail>
3535
`,
3636
// #enddocregion hero-detail-template
3737
styles: [`

public/docs/_examples/toh-3/ts/app/app.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
44
import { FormsModule } from '@angular/forms';
55

6-
import { AppComponent } from './app.component';
6+
import { AppComponent } from './app.component';
77
// #docregion hero-detail-import
88
import { HeroDetailComponent } from './hero-detail.component';
99
// #enddocregion hero-detail-import
1010

11-
// #docregion declarations
1211
@NgModule({
1312
imports: [
1413
BrowserModule,
1514
FormsModule
1615
],
16+
// #docregion declarations
1717
declarations: [
1818
AppComponent,
1919
HeroDetailComponent
2020
],
21+
// #enddocregion declarations
2122
bootstrap: [ AppComponent ]
2223
})
2324
export class AppModule { }
24-
// #enddocregion declarations
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// #docplaster
2+
// #docregion v1
3+
import { Component } from '@angular/core';
4+
5+
// #enddocregion v1
6+
// #docregion hero-import
7+
import { Hero } from './hero';
8+
// #enddocregion hero-import
9+
10+
// #docregion v1
11+
@Component({
12+
selector: 'hero-detail',
13+
// #enddocregion v1
14+
// #docregion template
15+
template: `
16+
<div *ngIf="hero">
17+
<h2>{{hero.name}} details!</h2>
18+
<div><label>id: </label>{{hero.id}}</div>
19+
<div>
20+
<label>name: </label>
21+
<input [(ngModel)]="hero.name" placeholder="name"/>
22+
</div>
23+
</div>
24+
`
25+
// #enddocregion template
26+
// #docregion v1
27+
})
28+
export class HeroDetailComponent {
29+
// #enddocregion v1
30+
// #docregion hero
31+
hero: Hero;
32+
// #enddocregion hero
33+
// #docregion v1
34+
}
35+
// #enddocregion v1
Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
// #docplaster
21
// #docregion
3-
// #docregion v1
2+
// #docregion import-input
43
import { Component, Input } from '@angular/core';
4+
// #enddocregion import-input
55

6-
// #enddocregion v1
7-
// #docregion hero-import
86
import { Hero } from './hero';
9-
// #enddocregion hero-import
107

11-
// #docregion v1
128
@Component({
13-
selector: 'my-hero-detail',
14-
// #enddocregion v1
15-
// #docregion template
9+
selector: 'hero-detail',
1610
template: `
1711
<div *ngIf="hero">
1812
<h2>{{hero.name}} details!</h2>
@@ -23,17 +17,12 @@ import { Hero } from './hero';
2317
</div>
2418
</div>
2519
`
26-
// #enddocregion template
27-
// #docregion v1
2820
})
21+
// #docregion class
2922
export class HeroDetailComponent {
30-
// #enddocregion v1
31-
// #docregion hero-input
32-
@Input()
3323
// #docregion hero
34-
hero: Hero;
24+
@Input() hero: Hero;
3525
// #enddocregion hero
36-
// #enddocregion hero-input
37-
// #docregion v1
3826
}
39-
// #enddocregion v1
27+
// #docregion class
28+

public/docs/_examples/toh-3/ts/plnkr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"description": "Tour of Heroes: Part 3",
33
"files":[
44
"!**/*.d.ts",
5-
"!**/*.js"
5+
"!**/*.js",
6+
"!**/*.[1].*"
67
],
78
"tags": ["tutorial", "tour", "heroes"]
89
}

public/docs/_examples/toh-4/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ function getPageElts() {
128128
return {
129129
heroes: element.all(by.css('my-app li')),
130130
selected: element(by.css('my-app li.selected')),
131-
heroDetail: element(by.css('my-app > div, my-app > my-hero-detail > div'))
131+
heroDetail: element(by.css('my-app > div, my-app > hero-detail > div'))
132132
};
133133
}

public/docs/_examples/toh-4/ts/app/app.component.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { HeroService } from './hero.service.2';
1717
<div *ngFor="let hero of heroes" (click)="onSelect(hero)">
1818
{{hero.name}}
1919
</div>
20-
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
20+
<hero-detail [hero]="selectedHero"></hero-detail>
2121
`,
2222
// #docregion providers
2323
providers: [HeroService]

public/docs/_examples/toh-4/ts/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { HeroService } from './hero.service';
2020
<span class="badge">{{hero.id}}</span> {{hero.name}}
2121
</li>
2222
</ul>
23-
<my-hero-detail [hero]="selectedHero"></my-hero-detail>
23+
<hero-detail [hero]="selectedHero"></hero-detail>
2424
`,
2525
// #enddocregion template
2626
styles: [`

public/docs/_examples/toh-4/ts/app/hero-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component, Input } from '@angular/core';
33
import { Hero } from './hero';
44

55
@Component({
6-
selector: 'my-hero-detail',
6+
selector: 'hero-detail',
77
template: `
88
<div *ngIf="hero">
99
<h2>{{hero.name}} details!</h2>

public/docs/_examples/toh-5/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Tutorial part 5', () => {
5757
selectedHero: element(by.css('my-app li.selected')),
5858
selectedHeroSubview: element(by.css('my-app my-heroes > div')),
5959

60-
heroDetail: element(by.css('my-app my-hero-detail > div'))
60+
heroDetail: element(by.css('my-app hero-detail > div'))
6161
};
6262
}
6363

public/docs/_examples/toh-5/ts/app/hero-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { HeroService } from './hero.service';
1111
// #docregion metadata
1212
@Component({
1313
moduleId: module.id,
14-
selector: 'my-hero-detail',
14+
selector: 'hero-detail',
1515
templateUrl: './hero-detail.component.html',
1616
// #enddocregion metadata, v2
1717
styleUrls: [ './hero-detail.component.css' ]

public/docs/_examples/toh-6/e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('Tutorial part 6', () => {
6363
selectedHero: element(by.css('my-app li.selected')),
6464
selectedHeroSubview: element(by.css('my-app my-heroes > div:last-child')),
6565

66-
heroDetail: element(by.css('my-app my-hero-detail > div')),
66+
heroDetail: element(by.css('my-app hero-detail > div')),
6767

6868
searchBox: element(by.css('#search-box')),
6969
searchResults: element.all(by.css('.search-result'))

public/docs/_examples/toh-6/ts/app/hero-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { HeroService } from './hero.service';
99

1010
@Component({
1111
moduleId: module.id,
12-
selector: 'my-hero-detail',
12+
selector: 'hero-detail',
1313
templateUrl: './hero-detail.component.html',
1414
styleUrls: [ './hero-detail.component.css' ]
1515
})

public/docs/ts/latest/guide/router.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ figure.image-display
802802
- Delete the `selector` (routed component don't need them).
803803
- Delete the `<h1>`.
804804
- Relabel the `<h2>` to `<h2>HEROES</h2>`.
805-
- Delete the `<my-hero-detail>` at the bottom of the template.
805+
- Delete the `<hero-detail>` at the bottom of the template.
806806
- Rename the `AppComponent` class to `HeroListComponent`.
807807
- Copy the `hero-detail.component.ts` and the `hero.service.ts` files into the `heroes` subfolder.
808808
- Create a (pre-routing) `heroes.module.ts` in the heroes folder that looks like this:

public/docs/ts/latest/guide/style-guide.jade

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ a(id='toc')
6868
to all components, services, and other symbols.
6969
This helps make the app cleaner, easier to read and maintain, and more testable.
7070

71+
a#rule-of-one
72+
:marked
7173
### <a id="01-01"></a>_Rule of One_
7274
#### <a href="#01-01">Style 01-01</a>
7375
.s-rule.do

public/docs/ts/latest/tutorial/toh-pt1.jade

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ include ../_util-fns
2727
:marked
2828
When you're done with this page, the app should look like this <live-example></live-example>.
2929

30+
a#keep-transpiling
31+
:marked
3032
## Keep the app transpiling and running
3133
Enter the following command in the terminal window:
3234

0 commit comments

Comments
 (0)