@@ -4,10 +4,7 @@ include ../_util-fns
44 ## Setup to develop locally
55 Follow the [setup](../guide/setup.html) instructions for creating a new project
66 named <ngio-ex path="angular-tour-of-heroes"></ngio-ex>.
7- <!-- CF: TO DO: Ward commented: if you only followed the current setup instructions, there would be many more files.
8- I just added a section to the Setup guide for deleting non-essential files. We should refer to that too.
9- See #3079 which will merge soon. The link to it would be:
10- [_Deleting non-essential files_](../guide/setup.html#non-essential "Setup: Deleting non-essential files") -->
7+
118 The file structure should look like this:
129
1310.filetree
@@ -24,7 +21,7 @@ include ../_util-fns
2421 .file styles.css
2522 .file systemjs.config.js
2623 .file tsconfig.json
27- .file node_modules ...
24+ .file node_modules ...
2825 .file package.json
2926:marked
3027 When you're done with this page, the app should look like this <live-example></live-example>.
@@ -40,7 +37,7 @@ code-example(language="sh" class="code-shell").
4037:marked
4138 This command runs the TypeScript compiler in "watch mode", recompiling automatically when the code changes.
4239 The command simultaneously launches the app in a browser and refreshes the browser when the code changes.
43-
40+
4441 You can keep building the Tour of Heroes without pausing to recompile or refresh the browser.
4542
4643.l-main-section
@@ -52,7 +49,7 @@ code-example(language="sh" class="code-shell").
5249 + makeExample('toh-1/ts/app/app.component.1.ts' , 'app-component-1' , 'app.component.ts (AppComponent class)' )( format ="." )
5350
5451 :marked
55- Now update the template in the `@Component` decoration with data bindings to these new properties.
52+ Now update the template in the `@Component` decorator with data bindings to these new properties.
5653
5754 + makeExample('toh-1/ts/app/app.component.1.ts' , 'show-hero' , 'app.component.ts (@Component)' )( format ='.' )
5855
@@ -80,7 +77,7 @@ code-example(language="sh" class="code-shell").
8077
8178:marked
8279 In the `Hero` class, refactor the component's `hero` property to be of type `Hero`,
83- then initialize it with an id of `1` and the name `Windstorm`.
80+ then initialize it with an `id` of `1` and the name `Windstorm`.
8481
8582+ makeExample('toh-1/ts/src/app/app.component.ts' , 'hero-property-1' , 'src/app/app.component.ts (hero property)' )( format ="." )
8683
@@ -98,8 +95,8 @@ code-example(language="sh" class="code-shell").
9895 add a `<div>` for the hero's `id` property and another `<div>` for the hero's `name`.
9996 To keep the template readable, place each `<div>` on its own line.
10097
101- The backticks around the component template let you put the `<h1>`, `<h2>`, and `<div>` elements on their own lines,
102- thanks to the <i>template literals</i> feature in ES2015 and TypeScript. For more information, see
98+ The backticks around the component template let you put the `<h1>`, `<h2>`, and `<div>` elements on their own lines,
99+ thanks to the <i>template literals</i> feature in ES2015 and TypeScript. For more information, see
103100 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals" target="_blank" title="template literal">Template literals</a>.
104101
105102
@@ -122,13 +119,13 @@ code-example(language="sh" class="code-shell").
122119
123120:marked
124121 `[(ngModel)]` is the Angular syntax to bind the `hero.name` property
125- to the textbox.
122+ to the textbox.
126123 Data flow _in both directions_: from the property to the textbox;
127124 and from the textbox back to the property.
128125
129126 Unfortunately, immediately after this change, the application breaks.
130127 If you looked in the browser console, you'd see Angular complaining that
131- " ' ngModel' ... isn't a known property of ' input' ."
128+ "` ngModel` ... isn't a known property of ` input` ."
132129
133130 Although `NgModel` is a valid Angular directive, it isn't available by default.
134131 It belongs to the optional `FormsModule`.
@@ -137,18 +134,18 @@ code-example(language="sh" class="code-shell").
137134 ### Import the _FormsModule_
138135
139136 Open the `app.module.ts` file and import the `FormsModule` symbol from the `@angular/forms` library.
140- Then add the `FormsModule` to the `NgModule` metadata's `imports` array, which contains the list
137+ Then add the `FormsModule` to the `@ NgModule` metadata's `imports` array, which contains the list
141138 of external modules that the app uses.
142-
139+
143140 The updated `AppModule` looks like this:
144- + makeExample('toh-1/ts/app/app.module.ts' , '' , 'app.module.ts (FormsModule import)' )
141+ + makeExample('toh-1/ts/src/ app/app.module.ts' , '' , 'app.module.ts (FormsModule import)' )
145142
146143.l-sub-section
147144 :marked
148145 Read more about `FormsModule` and `ngModel` in the
149- [_Two -way data binding with ngModel_ ](../guide/forms.html#ngModel) section of the
146+ [Two -way data binding with ngModel ](../guide/forms.html#ngModel) section of the
150147 [Forms](../guide/forms.html) guide and the
151- [_Two -way binding with NgModel_ ](../guide/template-syntax.html#ngModel) section of the
148+ [Two -way binding with NgModel ](../guide/template-syntax.html#ngModel) section of the
152149 [Template Syntax](../guide/template-syntax.html) guide.
153150
154151:marked
@@ -171,7 +168,7 @@ code-example(language="sh" class="code-shell").
171168
172169 Here's the complete `app.component.ts` as it stands now:
173170
174- + makeExample('toh-1/ts/src/app/app.component.ts' , 'pt1 ' , 'src/app/app.component.ts' )
171+ + makeExample('toh-1/ts/src/app/app.component.ts' , '' , 'src/app/app.component.ts' )
175172
176173
177174.l-main-section
0 commit comments