@@ -10,9 +10,8 @@ include ../../../_includes/_util-fns
10
10
in JavaScript and Dart by selecting either of those languages from the combo-box in the banner.
11
11
12
12
.l-main-section
13
-
14
13
:markdown
15
- # The shortest, quickest ...
14
+ ## The shortest, quickest ...
16
15
17
16
Let's put something on the screen in Angular 2 as quickly as we can.
18
17
@@ -29,15 +28,16 @@ include ../../../_includes/_util-fns
29
28
:markdown
30
29
**Create a new folder** to hold our application project, perhaps like this:
31
30
```
32
- mkdir angular2-getting-started
33
- cd angular2-getting-started
31
+ mkdir angular2-quickstart
32
+ cd angular2-quickstart
34
33
```
35
-
34
+ .l-main-section
35
+ :markdown
36
36
## Our first Angular component
37
37
38
38
**Add a new file** called **`app.ts`** and paste the following lines:
39
39
40
- + makeExample('gettingstarted /ts/src/app/app.ts' , null , 'app.ts' )
40
+ + makeExample('quickstart /ts/src/app/app.ts' , null , 'app.ts' )
41
41
42
42
:markdown
43
43
We've just defined an Angular 2 **component**,
@@ -80,13 +80,15 @@ include ../../../_includes/_util-fns
80
80
We no longer expect to find our code or any library code in a global namespace.
81
81
We `import` exactly what we need, as we need it, from named file and library resources.
82
82
83
+ .l-main-section
84
+ :markdown
83
85
## Add `index.html`
84
86
85
87
**Create** an `index.html` file.
86
88
87
89
**Paste** the following lines into it ... and we'll discuss them:
88
90
89
- + makeExample('gettingstarted /ts/src/index.1.html' , null , 'index.html' )
91
+ + makeExample('quickstart /ts/src/index.1.html' , null , 'index.html' )
90
92
91
93
:markdown
92
94
We see three noteworthy sections of HTML:
@@ -107,6 +109,8 @@ include ../../../_includes/_util-fns
107
109
That's the custom HTML element we identified in the `@Component` decoration
108
110
adorning our `AppComponent` class.
109
111
112
+ .l-main-section
113
+ :markdown
110
114
## Run it!
111
115
112
116
We need a static file server to serve our application to the browser.
@@ -135,13 +139,12 @@ include ../../../_includes/_util-fns
135
139
In a few moments, a browser tab should open and display
136
140
137
141
figure.image-display
138
- img( src ='/resources/images/devguide/getting-started /my-first-app.png' alt ="Output of getting started app" )
142
+ img( src ='/resources/images/devguide/quickstart /my-first-app.png' alt ="Output of quickstart app" )
139
143
140
144
:markdown
141
145
Congratulations! We are in business.
142
146
143
147
.l-main-section
144
-
145
148
:markdown
146
149
## What's wrong with this?
147
150
@@ -169,9 +172,8 @@ include ../../../_includes/_util-fns
169
172
We have tools and procedures for that.
170
173
171
174
.l-main-section
172
-
173
175
:markdown
174
- # Upping our game
176
+ ## Upping our game
175
177
Let's take a few more steps to put our development on a better foundation. We will
176
178
177
179
1. Revise the application project structure for future growth
@@ -185,7 +187,7 @@ include ../../../_includes/_util-fns
185
187
:markdown
186
188
## Revise the application project structure
187
189
188
- At the moment we're dumping everything into the "angular2-getting-started " **root folder**.
190
+ At the moment we're dumping everything into the "angular2-quickstart " **root folder**.
189
191
Not bad when there are only two files. Not good as our application evolves.
190
192
191
193
Let's give our project a little structure.
@@ -211,15 +213,14 @@ include ../../../_includes/_util-fns
211
213
212
214
Our project folders should look like this.
213
215
```
214
- angular2-getting-started
216
+ angular2-quickstart
215
217
└── src
216
218
├── app
217
219
│ └── app.ts
218
220
└── index.html
219
221
```
220
222
221
223
.l-main-section
222
-
223
224
:markdown
224
225
## Install npm packages locally
225
226
@@ -253,12 +254,12 @@ include ../../../_includes/_util-fns
253
254
help us develop and maintain our application in future.
254
255
The essence of our `package.json` should look like this:
255
256
256
- + makeJson('gettingstarted /ts/package.json' , { paths: ' name, version, dependencies, devDependencies' })
257
+ + makeJson('quickstart /ts/package.json' , { paths: ' name, version, dependencies, devDependencies' })
257
258
258
259
:markdown
259
260
There is also a `scripts` section. **Find and replace** it with the following:
260
261
261
- + makeJson('gettingstarted /ts/package.json' , { paths: ' scripts' })
262
+ + makeJson('quickstart /ts/package.json' , { paths: ' scripts' })
262
263
263
264
:markdown
264
265
We've just extended our project world with script commands
@@ -271,12 +272,12 @@ include ../../../_includes/_util-fns
271
272
**Replace** the library scripts section with references to
272
273
scripts in the packages we just installed.
273
274
274
- + makeExample('gettingstarted /ts/src/index.html' , 'libraries' )
275
+ + makeExample('quickstart /ts/src/index.html' , 'libraries' )
275
276
276
277
:markdown
277
278
**Update** the `System` configuration script as follows.
278
279
279
- + makeExample('gettingstarted /ts/src/index.html' , 'systemjs' )
280
+ + makeExample('quickstart /ts/src/index.html' , 'systemjs' )
280
281
281
282
.l-sub-section
282
283
:markdown
@@ -300,7 +301,7 @@ include ../../../_includes/_util-fns
300
301
:markdown
301
302
Here's the final version
302
303
303
- + makeExample('gettingstarted /ts/src/index.html' , null , 'index.html' )
304
+ + makeExample('quickstart /ts/src/index.html' , null , 'index.html' )
304
305
305
306
.l-main-section
306
307
:markdown
@@ -313,7 +314,7 @@ include ../../../_includes/_util-fns
313
314
to simplify the TypeScript compilation command that we'll run very soon.
314
315
315
316
**Change to the `src` folder and create a `tsconfig.json`** file with the following content:
316
- + makeJson('gettingstarted /ts/src/tsconfig.json' , null , 'tsconfig.json' )
317
+ + makeJson('quickstart /ts/src/tsconfig.json' , null , 'tsconfig.json' )
317
318
318
319
.alert.is-helpful
319
320
:markdown
@@ -325,7 +326,7 @@ include ../../../_includes/_util-fns
325
326
## Final structure
326
327
Our final project folder structure should look like this:
327
328
```
328
- angular2-getting-started
329
+ angular2-quickstart
329
330
├── node_modules
330
331
├── src
331
332
│ ├── app
@@ -377,7 +378,7 @@ include ../../../_includes/_util-fns
377
378
and displays our application message once more:
378
379
379
380
figure.image-display
380
- img( src ='/resources/images/devguide/getting-started /my-first-app.png' alt ="Output of getting started app" )
381
+ img( src ='/resources/images/devguide/quickstart /my-first-app.png' alt ="Output of quickstart app" )
381
382
382
383
:markdown
383
384
### Make some changes
0 commit comments