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

Commit cd0c363

Browse files
authored
docs(toh-2): move app.component.1.html (#3488)
1 parent 2f6097d commit cd0c363

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ code-example(language="sh" class="code-shell").
6161
Create a public property in `AppComponent` that exposes the heroes for binding.
6262

6363

64-
+makeExample('toh-2/ts/app/app.component.1.html', 'hero-array-1', 'app.component.ts (hero array property)')
64+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'hero-array-1', 'app.component.ts (hero array property)')
6565

6666
:marked
6767
The `heroes` type isn't defined because TypeScript infers it from the `HEROES` array.
@@ -77,7 +77,7 @@ code-example(language="sh" class="code-shell").
7777
insert the following chunk of HTML below the title and above the hero details.
7878

7979

80-
+makeExample('toh-2/ts/app/app.component.1.html', 'heroes-template-1', 'app.component.ts (heroes template)')(format='.')
80+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'heroes-template-1', 'app.component.ts (heroes template)')(format='.')
8181

8282
:marked
8383
Now you can fill the template with hero names.
@@ -89,7 +89,7 @@ code-example(language="sh" class="code-shell").
8989

9090
Modify the `<li>` tag by adding the built-in directive `*ngFor`.
9191

92-
+makeExample('toh-2/ts/app/app.component.1.html', 'heroes-ngfor-1', 'app.component.ts (ngFor)')
92+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'heroes-ngfor-1', 'app.component.ts (ngFor)')
9393

9494

9595
.l-sub-section
@@ -116,7 +116,7 @@ code-example(language="sh" class="code-shell").
116116
that uses the `hero` template variable to display the hero's properties.
117117

118118

119-
+makeExample('toh-2/ts/app/app.component.1.html', 'ng-for', 'app.component.ts (ngFor template)')(format=".")
119+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'ng-for', 'app.component.ts (ngFor template)')(format=".")
120120

121121
:marked
122122
When the browser refreshes, a list of heroes appears.
@@ -140,7 +140,7 @@ code-example(language="sh" class="code-shell").
140140
The template for displaying heroes should look like this:
141141

142142

143-
+makeExample('toh-2/ts/app/app.component.1.html', 'heroes-styled', 'src/app/app.component.ts (styled heroes)')(format='.')
143+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'heroes-styled', 'src/app/app.component.ts (styled heroes)')(format='.')
144144

145145
.l-main-section
146146
:marked
@@ -158,7 +158,7 @@ code-example(language="sh" class="code-shell").
158158
Add a click event binding to the `<li>` like this:
159159

160160

161-
+makeExample('toh-2/ts/app/app.component.1.html', 'selectedHero-click', 'app.component.ts (template excerpt)')(format='.')
161+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'selectedHero-click', 'app.component.ts (template excerpt)')(format='.')
162162

163163
:marked
164164
The parentheses identify the `<li>` element's `click` event as the target.
@@ -183,15 +183,15 @@ code-example(language="sh" class="code-shell").
183183
The hero names should all be unselected before the user picks a hero, so
184184
you won't initialize the `selectedHero` as you did with `hero`.
185185

186-
Add an `onSelect` method that sets the `selectedHero` property to the `hero` that the user clicks.
186+
Add an `onSelect()` method that sets the `selectedHero` property to the `hero` that the user clicks.
187187
+makeExample('toh-2/ts/src/app/app.component.ts', 'on-select', 'src/app/app.component.ts (onSelect)')(format='.')
188188

189189
:marked
190190
The template still refers to the old `hero` property.
191191
Bind to the new selectedHero property instead as follows:
192192

193193

194-
+makeExample('toh-2/ts/app/app.component.1.html', 'selectedHero-details', 'app.component.ts (template excerpt)')(format='.')
194+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'selectedHero-details', 'app.component.ts (template excerpt)')(format='.')
195195

196196
:marked
197197
### Hide the empty detail with ngIf
@@ -210,7 +210,7 @@ code-example(language="sh" class="code-shell").
210210
Wrap the HTML hero detail content of the template with a `<div>`.
211211
Then add the `ngIf` built-in directive and set it to the `selectedHero` property of the component.
212212

213-
+makeExample('toh-2/ts/app/app.component.1.html', 'ng-if', 'src/app/app.component.ts (ngIf)')(format='.')
213+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'ng-if', 'src/app/app.component.ts (ngIf)')(format='.')
214214

215215
.alert.is-critical
216216
:marked
@@ -248,7 +248,7 @@ code-example(language="sh" class="code-shell").
248248
img(src='/resources/images/devguide/toh/heroes-list-selected.png' alt="Selected hero")
249249
:marked
250250
In the template, add the following `[class.selected]` binding to the `<li>`:
251-
+makeExample('toh-2/ts/app/app.component.1.html', 'class-selected-1', 'app.component.ts (setting the CSS class)')(format=".")
251+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'class-selected-1', 'app.component.ts (setting the CSS class)')(format=".")
252252
:marked
253253
When the expression (`hero === selectedHero`) is `true`, Angular adds the `selected` CSS class.
254254
When the expression is `false`, Angular removes the `selected` class.
@@ -260,7 +260,7 @@ code-example(language="sh" class="code-shell").
260260

261261
:marked
262262
The final version of the `<li>` looks like this:
263-
+makeExample('toh-2/ts/app/app.component.1.html', 'class-selected-2', 'app.component.ts (styling each hero)')(format=".")
263+
+makeExample('toh-2/ts/src/app/app.component.1.html', 'class-selected-2', 'app.component.ts (styling each hero)')(format=".")
264264

265265
:marked
266266
After clicking "Magneta", the list should look like this:

0 commit comments

Comments
 (0)