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

Commit c7717b4

Browse files
chalinkwalrath
authored andcommitted
docs(toh): fix code-example format and Dart code excerpt (#2907)
* ensure HeroesComponent renaming doesn't show router * use code-example format consistent with the rest of the docs
1 parent 4fe2410 commit c7717b4

File tree

14 files changed

+30
-26
lines changed

14 files changed

+30
-26
lines changed

public/docs/_examples/toh-5/dart/lib/heroes_component.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ class HeroesComponent implements OnInit {
2626
Hero selectedHero;
2727

2828
// #docregion renaming
29-
HeroesComponent(this._heroService, this._router);
29+
HeroesComponent(this._heroService,
30+
// #enddocregion renaming
31+
this._router
32+
// #docregion renaming
33+
);
3034
// #enddocregion renaming
3135

3236
Future<Null> getHeroes() async {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ include ../_util-fns
3838
## Keep the app compiling and running
3939
We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing
4040

41-
code-example(language="bash").
41+
code-example(language="sh" class="code-shell").
4242
pub serve
4343

4444
:marked

public/docs/dart/latest/tutorial/toh-pt2.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ include ../_util-fns
3434
### Keep the app compiling and running
3535
We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing
3636

37-
code-example(language="bash").
37+
code-example(language="sh" class="code-shell").
3838
pub serve
3939

4040
:marked
@@ -157,7 +157,7 @@ code-example(language="bash").
157157

158158
:marked
159159
Focus on the event binding
160-
code-example(format="." language="bash").
160+
code-example.
161161
(click)="onSelect(hero)"
162162
:marked
163163
The parentheses identify the `<li>` element’s `click` event as the target.
@@ -204,7 +204,7 @@ code-example(language="bash").
204204
The `selectedHero` is `undefined`.
205205
That’s why we'll see the following error in the browser’s console:
206206

207-
code-example(language="html").
207+
code-example(format="nocode").
208208
EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]
209209

210210
:marked

public/docs/dart/latest/tutorial/toh-pt3.jade

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ include ../_util-fns
2727
### Keep the app compiling and running
2828
We want to start the Dart compiler, have it watch for changes, and start our server. We'll do this by typing
2929

30-
code-example(language="bash").
30+
code-example(language="sh" class="code-shell").
3131
pub serve
3232

3333
:marked
@@ -122,7 +122,7 @@ code-example(language="bash").
122122

123123
We will soon update the `AppComponent` template so that it binds its `selectedHero` property
124124
to the `hero` property of our `HeroDetailComponent`. The binding *might* look like this:
125-
code-example(format=".").
125+
code-example(language="html").
126126
&lt;my-hero-detail [hero]="selectedHero">&lt;/my-hero-detail>
127127
:marked
128128
Notice that the `hero` property is the ***target*** of a property binding &mdash; it's in square brackets to the left of the (=).
@@ -156,15 +156,15 @@ code-example(format=".").
156156
:marked
157157
Find the location in the template where we removed the *Hero Detail* content
158158
and add an element tag that represents the `HeroDetailComponent`.
159-
code-example(format=".").
159+
code-example(language="html").
160160
&lt;my-hero-detail>&lt;/my-hero-detail>
161161
.l-sub-section
162162
:marked
163163
*my-hero-detail* is the name we set as the `selector` in the `HeroDetailComponent` metadata.
164164
:marked
165165
The two components won't coordinate until we bind the `selectedHero` property of the `AppComponent`
166166
to the `HeroDetailComponent` element's `hero` property like this:
167-
code-example(format=".").
167+
code-example(language="html").
168168
&lt;my-hero-detail [hero]="selectedHero">&lt;/my-hero-detail>
169169
:marked
170170
The `AppComponent`’s template should now look like this

public/docs/dart/latest/tutorial/toh-pt4.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ include ../_util-fns
4141
Open a terminal/console window.
4242
Start the Dart compiler, watch for changes, and start our server by entering the command:
4343

44-
code-example(language="bash").
44+
code-example(language="sh" class="code-shell").
4545
pub serve
4646

4747
:marked

public/docs/dart/latest/tutorial/toh-pt5.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ block keep-app-running
3232
Open a terminal/console window.
3333
Start the Dart compiler, watch for changes, and start our server by entering the command:
3434

35-
code-example(language="bash").
35+
code-example(language="sh" class="code-shell").
3636
pub serve
3737

3838
block app-comp-v1

public/docs/dart/latest/tutorial/toh-pt6.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ block start-server-and-watch
1616
Open a terminal/console window.
1717
Start the Dart compiler, watch for changes, and start our server by entering the command:
1818

19-
code-example(language="bash").
19+
code-example(language="sh" class="code-shell").
2020
pub serve
2121

2222
block http-library

public/docs/ts/_cache/tutorial/toh-pt5.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ block keep-app-running
6969
Open a terminal/console window and enter the following command to
7070
start the TypeScript compiler, start the server, and watch for changes:
7171

72-
code-example(language="bash").
72+
code-example(language="sh" class="code-shell").
7373
npm start
7474

7575
:marked
@@ -438,7 +438,7 @@ code-example(language="html").
438438
We *can* add the hero's `id` to the URL. When routing to the hero whose `id` is 11,
439439
we could expect to see an URL such as this:
440440

441-
code-example(format='').
441+
code-example(format="nocode").
442442
/detail/11
443443

444444
:marked

public/docs/ts/_cache/tutorial/toh-pt6.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ block start-server-and-watch
3434
Open a terminal/console window and enter the following command to
3535
start the TypeScript compiler, start the server, and watch for changes:
3636

37-
code-example(language="bash").
37+
code-example(language="sh" class="code-shell").
3838
npm start
3939

4040
:marked

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ include ../_util-fns
3636
### Keep the app transpiling and running
3737
We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing
3838

39-
code-example(language="bash").
39+
code-example(language="sh" class="code-shell").
4040
npm start
4141

4242
:marked
@@ -161,7 +161,7 @@ code-example(language="bash").
161161

162162
:marked
163163
Focus on the event binding
164-
code-example(format="." language="bash").
164+
code-example.
165165
(click)="onSelect(hero)"
166166
:marked
167167
The parenthesis identify the `<li>` element’s `click` event as the target.
@@ -209,7 +209,7 @@ code-example(language="bash").
209209
The `selectedHero` is `undefined`.
210210
That’s why we'll see the following error in the browser’s console:
211211

212-
code-example(language="html").
212+
code-example(format="nocode").
213213
EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]
214214

215215
:marked

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ include ../_util-fns
2929
### Keep the app transpiling and running
3030
We want to start the TypeScript compiler, have it watch for changes, and start our server. We'll do this by typing
3131

32-
code-example(language="bash").
32+
code-example(language="sh" class="code-shell").
3333
npm start
3434

3535
:marked
@@ -124,7 +124,7 @@ code-example(language="bash").
124124

125125
We will soon update the `AppComponent` template so that it binds its `selectedHero` property
126126
to the `hero` property of our `HeroDetailComponent`. The binding *might* look like this:
127-
code-example(format=".").
127+
code-example(language="html").
128128
&lt;my-hero-detail [hero]="selectedHero">&lt;/my-hero-detail>
129129
:marked
130130
Notice that the `hero` property is the ***target*** of a property binding &mdash; it's in square brackets to the left of the (=).
@@ -169,15 +169,15 @@ code-example(format=".").
169169
Now that the application knows about our `HeroDetailComponent`,
170170
find the location in the `AppComponent` template where we removed the *Hero Detail* content
171171
and add an element tag that represents the `HeroDetailComponent`.
172-
code-example(format=".").
172+
code-example(language="html").
173173
&lt;my-hero-detail>&lt;/my-hero-detail>
174174
.l-sub-section
175175
:marked
176176
*my-hero-detail* is the name we set as the `selector` in the `HeroDetailComponent` metadata.
177177
:marked
178178
The two components won't coordinate until we bind the `selectedHero` property of the `AppComponent`
179179
to the `HeroDetailComponent` element's `hero` property like this:
180-
code-example(format=".")
180+
code-example(language="html").
181181
&lt;my-hero-detail [hero]="selectedHero">&lt;/my-hero-detail>
182182
:marked
183183
The `AppComponent`’s template should now look like this

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ include ../_util-fns
4444
Open a terminal/console window.
4545
Start the TypeScript compiler, watch for changes, and start our server by entering the command:
4646

47-
code-example(language="bash").
47+
code-example(language="sh" class="code-shell").
4848
npm start
4949

5050
:marked

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ block keep-app-running
6969
Open a terminal/console window and enter the following command to
7070
start the TypeScript compiler, start the server, and watch for changes:
7171

72-
code-example(language="bash").
72+
code-example(language="sh" class="code-shell").
7373
npm start
7474

7575
:marked
@@ -438,7 +438,7 @@ code-example(language="html").
438438
We *can* add the hero's `id` to the URL. When routing to the hero whose `id` is 11,
439439
we could expect to see an URL such as this:
440440

441-
code-example(format='').
441+
code-example(format="nocode").
442442
/detail/11
443443

444444
:marked

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ block start-server-and-watch
3434
Open a terminal/console window and enter the following command to
3535
start the TypeScript compiler, start the server, and watch for changes:
3636

37-
code-example(language="bash").
37+
code-example(language="sh" class="code-shell").
3838
npm start
3939

4040
:marked

0 commit comments

Comments
 (0)