@@ -55,22 +55,22 @@ code-example(language="sh" class="code-shell").
5555 ### Expose heroes
5656 Create a public property in `AppComponent` that exposes the heroes for binding.
5757
58- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'hero-array-1' , 'app.component.ts (hero array property)' )
58+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'hero-array-1' , 'app.component.ts (hero array property)' )
5959
6060:marked
6161 The `heroes` type isn't defined because TypeScript infers it from the `HEROES` array.
6262
6363.l-sub-section
64- :marked
65- The hero data is separated from the class implementation
66- because ultimately the hero names will come from a data service.
64+ :marked
65+ The hero data is separated from the class implementation
66+ because ultimately the hero names will come from a data service.
6767
6868:marked
6969 ### Display hero names in a template
7070 The component has `heroes`. To display the hero names in an unordered list,
7171 insert the following chunk of HTML below the title and above the hero details.
7272
73- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'heroes-template-1' , 'app.component.ts (heroes template)' )
73+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'heroes-template-1' , 'app.component.ts (heroes template)' ) ( format = '. ')
7474
7575:marked
7676 Now you can fill the template with hero names.
@@ -82,7 +82,7 @@ code-example(language="sh" class="code-shell").
8282
8383 Modify the `<li>` tag by adding the built-in directive `*ngFor`.
8484
85- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'heroes-ngfor-1' , 'app.component.ts (ngFor)' )
85+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'heroes-ngfor-1' , 'app.component.ts (ngFor)' )
8686
8787.alert.is-critical
8888 :marked
@@ -116,7 +116,7 @@ code-example(language="sh" class="code-shell").
116116 In the `<li>` tags, add content
117117 that uses the `hero` template variable to display the hero's properties.
118118
119- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'ng-for' , 'app.component.ts (ngFor template)' )( format ="." )
119+ + makeExample('toh-2/ts/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 displays.
@@ -127,7 +127,7 @@ code-example(language="sh" class="code-shell").
127127 To add styles to your component, set the `styles` property on the `@Component` decorator
128128 to the following CSS classes:
129129
130- + makeExample('toh-2/ts/app/app.component.ts' , 'styles' , 'app.component.ts (styles)' )( format = "." )
130+ + makeExample('toh-2/ts/app/app.component.ts' , 'styles' , 'app.component.ts (styles)' )
131131
132132:marked
133133 Notice that again you used the backtick notation for multi-line strings.
@@ -139,7 +139,7 @@ code-example(language="sh" class="code-shell").
139139
140140 The template for displaying heroes should look like this:
141141
142- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'heroes-styled' , 'app.component.ts (styled heroes)' )
142+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'heroes-styled' , 'app.component.ts (styled heroes)' ) ( format = '. ')
143143
144144.l-main-section
145145 :marked
@@ -157,7 +157,7 @@ code-example(language="sh" class="code-shell").
157157 ### Add a click event
158158 Modify the `<li>` by inserting an Angular event binding to its click event.
159159
160- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'selectedHero-click' , 'app.component.ts (template excerpt)' )
160+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'selectedHero-click' , 'app.component.ts (template excerpt)' ) ( format = '. ')
161161
162162 :marked
163163 Notice the event binding:
@@ -187,13 +187,13 @@ code-example(language="sh" class="code-shell").
187187 you won't initialize the `selectedHero` as you did with `hero`.
188188
189189 Add an `onSelect` method that sets the `selectedHero` property to the `hero` that the user clicks.
190- + makeExample('toh-2/ts/app/app.component.ts' , 'on-select' , 'app.component.ts (onSelect)' )
190+ + makeExample('toh-2/ts/app/app.component.ts' , 'on-select' , 'app.component.ts (onSelect)' )( format = '.' )
191191
192192 :marked
193193 At the moment, the template still refers to the old `hero` property.
194194 To change the template to bind to the new `selectedHero` property, update the code as follows:
195195
196- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'selectedHero-details' , 'app.component.ts (template excerpt)' )
196+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'selectedHero-details' , 'app.component.ts (template excerpt)' ) ( format = '. ')
197197 :marked
198198 ### Hide the empty detail with ngIf
199199
@@ -212,7 +212,7 @@ code-example(language="sh" class="code-shell").
212212 Wrap the HTML hero detail content of your template with a `<div>`.
213213 Then add the `ngIf` built-in directive and set it to the `selectedHero` property of the component.
214214
215- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'ng-if' , 'app.component.ts (ngIf)' )
215+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'ng-if' , 'app.component.ts (ngIf)' ) ( format = '. ')
216216
217217 :marked
218218 The list of names displays again in the browser.
@@ -263,15 +263,15 @@ code-example(language="sh" class="code-shell").
263263 You can set the class to an expression that compares the current `selectedHero` to the `hero`.
264264
265265 The key is the name of the CSS class (`selected`). The value is `true` if the two heroes match and `false` if they don't.
266- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'class-selected-1' , 'app.component.ts (setting the CSS class)' )( format ="." )
266+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'class-selected-1' , 'app.component.ts (setting the CSS class)' )( format ="." )
267267 :marked
268268 Notice that `class.selected` is surrounded by square brackets (`[]`).
269269 This is the syntax for a *property binding*, in which data flows one way
270270 from the data source (the expression `hero === selectedHero`) to a property of `class`.
271271 // CF: What is the preferred style for introduced terms? In this page I see two: quotes (used in
272272 "master-detail" on line 151 and "structural directives" on line 241) and italics (used in
273273 *property binding* on line 270).
274- + makeExample('toh-2/ts-snippets /app.component.snippets.pt2.ts ' , 'class-selected-2' , 'app.component.ts (styling each hero)' )( format ="." )
274+ + makeExample('toh-2/ts/app/app .component.1.html ' , 'class-selected-2' , 'app.component.ts (styling each hero)' )( format ="." )
275275
276276 .l-sub-section
277277 :marked
0 commit comments