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

Commit f4d5d16

Browse files
committed
Cleanup on some of the ts guide files
1 parent 40a1027 commit f4d5d16

File tree

7 files changed

+60
-52
lines changed

7 files changed

+60
-52
lines changed

public/docs/ts/latest/guide/_data.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"title": "Getting Started"
1010
},
1111
"toh-pt1": {
12-
"title": "Tour of Heros Begins"
12+
"title": "Tour of Heroes Begins"
1313
},
1414
"displaying-data": {
1515
"title": "Displaying Data",

public/docs/ts/latest/guide/application-under-test.jade

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ include ../../../../_includes/_util-fns
33
:markdown
44
We’ll need an Angular application to test, one as simple as possible while having all the angular features we want to test.
55

6-
We have such an app that you can download [here](./#). It’s a one-screen variation on the “Tour of Heroes” that should be familiar to you as a reader of this Developers Guide.
6+
<!-- TODO We have such an app that you can download [here](./#). -->It’s a one-screen variation on the “Tour of Heroes” that should be familiar to you as a reader of this Developers Guide.
77

88
Our test app displays a list of heroes - all favorites of the user named “Bongo”. It looks like this:
99

1010
figure.image-display
11-
img(src='/resources/images/devguide/application-under-test/bongos-heroes.png' style="width:400px;" alt="Bong's Heroes")
11+
img(src='/resources/images/devguide/application-under-test/bongos-heroes.png'
12+
style="width:400px;" alt="Bongo's Heroes")
1213

1314
:markdown
1415
At the top is a master list of heroes; at the bottom the detail for the current hero. Click a hero in the list to change the current hero. Change the name in the textbox and that name updates everywhere. The *Update* button modifies the `Hero.name` in an arbitrary way and that change also propagates everywhere on screen. The *Delete* button deletes the hero from the list and a new hero becomes current. *Refresh* clears both the list and detail, then restores the original list of heroes.
1516

16-
You can see a short video of the app in action [here](./#)
17+
<!-- TODO You can see a short video of the app in action [here](./#) -->
1718

1819
This simple app illustrates a number of Angular features that we’d like to test.
1920

@@ -26,8 +27,8 @@ figure.image-display
2627
- The `name` textbox illustrates two-way databinding
2728
- The update button demonstrates that a programmatic change to the databound model propagates to both component views
2829
- The delete button triggers an event that is caught by the parent component
29-
- [TBD: need to add a filter and a directive to this sample]
30-
- [TBD: need to shoehorn the router in somehow]
30+
<!-- TODO - [TBD: need to add a filter and a directive to this sample] -->
31+
<!-- TODO - [TBD: need to shoehorn the router in somehow] -->
3132

3233
We’ll examine the implementation details as we evolve our tests.
3334

public/docs/ts/latest/guide/first-app-tests.jade

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ include ../../../../_includes/_util-fns
1515

1616
- you’ve learned the basics of Angular 2, from this Developers Guide or elsewhere. We won’t re-explain the Angular 2 architecture, its key parts, or the recommended development techniques.
1717
you’ve read the [Jasmine 101](./jasmine-testing-101.html) chapter.
18-
19-
- you’ve downloaded the [Heroes application we’re about to test](./#).
18+
- you’ve downloaded the [Heroes application we’re about to test](./#). <!-- TODO add link -->
2019

2120
## Create the test-runner HTML
2221

@@ -55,9 +54,7 @@ include ../../../../_includes/_util-fns
5554
pre.prettyprint.lang-bash
5655
code npm install jasmine-core --save-dev --save-exact
5756

58-
.alert.is-important
59-
:markdown
60-
Be sure to install `jasmine-core` , not `jasmine`!
57+
.alert.is-important Be sure to install <code>jasmine-core</code> , not <code>jasmine</code>!
6158

6259
:markdown
6360
Update the Typescript typings aggregation file (`tsd.d.ts`) with the Jasmine typings file.
@@ -265,7 +262,8 @@ figure.image-display
265262
1. import our test files
266263
1. tell Jasmine to run the imported tests
267264

268-
These step are all clearly visible, in exactly that order, in the following lines that replace the `<body>` contents in `unit-tests.html`:
265+
These steps are all clearly visible, in exactly that order, in the following lines that
266+
replace the `<body>` contents in `unit-tests.html`:
269267

270268
```
271269
<body>

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@ include ../../../../_includes/_util-fns
146146
in this manner for quite some time.
147147

148148
For a number of reasons this isn't a good approach for building an application.
149+
<!-- TODO The formatting here is a little weird. Should improve readability. -->
149150

150151
* Transpiling TypeScript in the browser becomes tediously slow when our
151-
app grows beyond a few files. We certainly won't do that in production.
152-
153-
We should learn to compile locally and
154-
push the generated JavaScript to the server. We'll need some tools for that.
152+
app grows beyond a few files. We certainly won't do that in production. We should learn to
153+
compile locally and push the generated JavaScript to the server. We'll need some tools for that.
155154

156155

157156
* We are writing TypeScript because we want strong-typing and some information
@@ -164,13 +163,9 @@ include ../../../../_includes/_util-fns
164163
* Downloading JavaScript libraries from the web is OK for demos but
165164
it slows our development. Every time our app reloads, it must refetch these libraries.
166165
Don't count on browser caching.
167-
Our debugging and live-reload techniques will bust the browser cache.
168-
169-
Loading libraries from the web also prevents us from developing our
170-
application offline or where connectivity is poor.
171-
172-
Let's learn to download the libraries to our machine and serve
173-
them locally.
166+
Our debugging and live-reload techniques will bust the browser cache. Loading libraries
167+
from the web also prevents us from developing our application offline or where connectivity is
168+
poor. Let's learn to download the libraries to our machine and serve them locally.
174169

175170

176171
* We want our development cycle to be as fast and friction-free as possible.

public/docs/ts/latest/guide/testing-an-angular-pipe.jade

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ code-example(format="linenums").
3333
- test this custom Angular pipe class
3434
- load multiple test files in our test harness, using system.js
3535

36-
.alert.is-critical
37-
:markdown
38-
This chapter assumes familiarity with basic Angular 2 concepts, the tools we introduced in [Getting Started](./gettingStarted.html) and [Tour of Heroes](./#), and earlier chapters of this Unit Testing series.
36+
.callout.is-helpful
37+
header Prior Knowledge
38+
p This chapter assumes familiarity with basic Angular 2 concepts, the tools we introduced in <a href="./gettingStarted.html">Getting Started</a> and <a href="./toh-pt1.html">Tour of Heroes</a>, and earlier chapters of this Unit Testing series.
3939

4040
:markdown
4141
## Add the Angular library
@@ -49,7 +49,8 @@ figure.image-display
4949
:markdown
5050
If we then opened the browser’s Developer Tools (F12, Ctrl-Shift-I) and looked in the console window, we would see.
5151

52-
`GET http://127.0.0.1:8080/src/angular2/angular2 404 (Not Found)`
52+
`GET http://127.0.0.1:8080/src/angular2/angular2 404 (Not Found)` <!--TODO probably belongs
53+
in a code box not as an inline code style -->
5354

5455
It is missing indeed!
5556

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

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,26 @@ include ../../../../_includes/_util-fns
1717

1818
We’ll cover just enough of the core fundamentals to get us started and build an app. Since we are covering a lot of ground, we’ll be able to go deeper on topics by following links as we go.
1919

20-
Selectable List of Heroes
20+
**Selectable List of Heroes**
2121
figure.image-display
2222
img(src='/resources/images/devguide/toh/heroes-list-1.png' alt="Output of heroes list app")
2323

2424
:markdown
25-
Hero Details
25+
**Hero Details**
2626
figure.image-display
2727
img(src='/resources/images/devguide/toh/hero-details-1.png' alt="Details of hero in app")
2828

2929
:markdown
3030
### **This is How We Roll**
3131
We’ll be building the Tour of Heroes together, step by step. Along the way we’ll learn many of the core fundamentals of Angular 2 as we construct the application. Each step is motivated by a requirement. Everything has a reason. We’ll motivate the direction the Tour of Heroes takes, and learn how to solve common application needs with Angular 2’s fundamentals.
3232

33-
## Getting Started
33+
## Initial App Setup
34+
<aside class="is-right">Find the basics of app setup in the Getting Started chapter.</aside>
3435

3536
### **Creating Tour of Heroes**
36-
After following Getting Started, copy the code to a new folder and rename the folder `angular2-tour-of-heroes`
3737

38-
*Sidenote: Follow the Getting Start guide in the [getting started chapter]*
38+
After following [Getting Started](../guide/gettingStarted.html), copy the code to a new folder and rename the folder
39+
`angular2-tour-of-heroes`
3940

4041
Our starting app from Getting Started should look like the following structure:
4142

@@ -66,13 +67,20 @@ include ../../../../_includes/_util-fns
6667
:markdown
6768
This will keep the application running while we continue to build the Tour of Heroes.
6869

69-
Note: These steps will watch the existing files and recompile and re-run the app when they change. However, if you notice the watchers do not pick up renamed or new files, stop these commands in terminal by typing `CTRL+C` and then re-run both commands.
70+
<!--TODO: style this with callout style and set a header-->Note: These steps will watch the
71+
existing files and
72+
recompile
73+
and re-run
74+
the app
75+
when they
76+
change. However, if you notice the watchers do not pick up renamed or new files, stop these commands in terminal by typing `CTRL+C` and then re-run both commands.
7077

7178
.l-main-section
7279

7380
:markdown
7481
## Let's Show our Hero
75-
We want to show data in our app, so let’s start by creating a title for our Tour of Heroes. We’ll also create a hero and display him.
82+
We want to show data in our app, so let’s start by creating a title for our Tour of Heroes.
83+
We’ll also create a hero and display her.
7684

7785
### **Displaying Data**
7886
We need to add properties in our component to store the title and the hero’s name. Let’s create `title` and `hero` properties in the component. We’ll set the title to Tour of Heroes and set the hero to Windstorm.
@@ -96,10 +104,11 @@ include ../../../../_includes/_util-fns
96104

97105
The curly braces tell our app to read the `title` and `hero` properties from the component and render them.
98106

99-
*Sidenote: Learn more about one-way binding in the [data binding chapter]*
107+
Learn more about one-way binding in the <!--TODO link-->Data Binding chapter.
100108

101109
### **Hero Object**
102-
Our hero has a name, but we want to him to have more properties. We’ll do this in TypeScript by creating a `Hero` class.
110+
Our hero has a name, but we want to her to have more properties. We’ll do this in TypeScript
111+
by creating a `Hero` class.
103112

104113
Let’s create the `Hero` class with `id` and `name` properties. We’ll put this in the `app.ts` file for now.
105114

@@ -191,7 +200,8 @@ include ../../../../_includes/_util-fns
191200

192201
Let’s fix that next by letting Angular know we want to use the ng-model directive.
193202

194-
*Sidenote: Learn more about ng-model in the [data binding chapter]*
203+
<!-- TODO style with a class and add a link *Sidenote: Learn more about ng-model in the [data
204+
binding chapter]* -->
195205

196206
### **FORM Directives**
197207
We just used the `ng-model` directive, but we must tell the component which directives we will use in the template. When we know which directives we want to use, we can import them from Angular 2 and tell the component’s view that we want to use them.
@@ -239,19 +249,22 @@ include ../../../../_includes/_util-fns
239249

240250
Angular bundles all the binding directives for forms together into `FORM_DIRECTIVES`. This is all we need to remember to light up our template. Fortunately, we can bundle a collection of directives together in an array, give it a catchy name, and we can plug that array into the `directives` property.
241251

242-
*Sidenote: Learn more about Angular 2 Forms in the [Forms chapter]*
252+
<!-- TODO *Sidenote: Learn more about Angular 2 Forms in the [Forms chapter]* -->
243253

244254
## Recap
245255

246256
### **The Road We’ve Travelled**
247-
Let’s take stock in what we’ve built.
248-
249-
> [formatting = undordered list. how?]
250-
> Our Tour of Heroes now includes one-way data binding to display a hero by wrapping properties with double curly braces in our template.
251-
> || We added two-way data binding so we can change the hero’s name and see those changes throughout all places the hero’s name is bound in the template.
252-
> || We built our template in the component’s file using ES2015’s template strings feature.
253-
> || We declared that we use the Form directives in our component and view.
254-
> || We used the special built-in `ng-model` directive with the `<input>` element to make the hero’s name display in the template. `ng-model` also helps us propagate any changes we make throughout all places bound to `hero.name` in the template.
255-
256-
### **The Road Ahead**
257-
Our Tour of Heroes only displays one hero and we really want to display a list of heroes. We also want to allow the user to select a hero and display his details. We’ll learn more about how to retrieve lists, bind them to the template, and allow a user to select it in the next chapter.
257+
Let’s take stock of what we’ve built.
258+
259+
* Our Tour of Heroes now includes one-way data binding to display a hero by wrapping
260+
properties with double curly braces in our template.
261+
* We added two-way data binding so we can change the hero’s name and see those changes throughout all places the hero’s name is bound in the template.
262+
* We built our template in the component’s file using ES2015’s template strings feature.
263+
* We declared that we use the Form directives in our component and view.
264+
* We used the special built-in `ng-model` directive with the `<input>` element to make the hero’s name display in the template. `ng-model` also helps us propagate any changes we make throughout all places bound to `hero.name` in the template.
265+
266+
<!-- TODO: Add this in when the next chapter exists ### **The Road Ahead**
267+
Our Tour of Heroes only displays one hero and we really want to display a list of heroes. We also want to allow the user to select a hero and display their details. We’ll learn more about
268+
how to retrieve lists, bind them to the
269+
template, and
270+
allow a user to select it in the next chapter. -->

public/docs/ts/latest/guide/unit-testing-01.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ figure.image-display
6464
* when to mock and how
6565

6666
## Unit Testing Chapters
67+
<!-- TODO This toc feels out of place here -->
6768

6869
Here is what we’ll learn in the unit testing chapters.
6970

@@ -111,9 +112,8 @@ figure.image-display
111112
It’s a big agenda. Fortunately, you can learn a little bit at a time and put each lesson to use.
112113

113114
.callout.is-helpful
114-
p These Unit Testing chapters build upon each other. We recommend reading them in order. <br/>We assume familiarity with basic Angular 2 concepts and the tools we introduced in
115-
<a href="./gettingStarted.html">Getting Started</a> and
116-
<a href="./toh-pt1.html">Tour of Heroes</a> such as `npm`, `gulp`, and `live-server`.
115+
header How to Use This Guide
116+
p The three Unit Testing chapters build upon each other. We recommend reading them in order. We're also assuming that you're already comfortable with basic Angular 2 concepts and the tools we introduced in <a href="./gettingStarted.html">Getting Started</a> and <a href="./toh-pt1.html">Tour of Heroes</a> such as <code>npm</code>, <code>gulp</code>, and <code>live-server</code>.
117117

118118
:markdown
119119
Let’s get started!

0 commit comments

Comments
 (0)