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

Commit a22b0b6

Browse files
committed
docs(Dart): sync with TS version of quickstart
1 parent a2e1075 commit a22b0b6

File tree

2 files changed

+53
-44
lines changed

2 files changed

+53
-44
lines changed

public/docs/dart/latest/quickstart.jade

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ block install-packages
4141
packages (along with the packages they depend on).
4242

4343
code-example(language="sh" class="code-shell").
44-
&gt; <span class="blk">pub get</span>
45-
Resolving dependencies...
44+
pub get
45+
46+
block create-your-app
47+
:marked
48+
Let's create a folder to hold our application and add a super-simple Angular component.
4649

4750
block annotation-fields
4851
:marked
@@ -57,6 +60,10 @@ block create-main
5760
li a #[b folder named #[code web]]
5861
li a <b>file named #[code #[+adjExPath('app/main.ts')]]</b> with the following content:
5962

63+
block commentary-on-index-html
64+
:marked
65+
Note the `<my-app>` tag in the `<body>`, this is *where your app lives!*
66+
6067
block run-app
6168
p.
6269
We have a few options for running our app.
@@ -76,9 +83,11 @@ block run-app
7683
Once the app is running, the browser window should show the following:
7784

7885
block build-app
86+
//- Remove details of building from QS for now. (It is too early for these details.)
87+
if false
7988
.alert.is-important
8089
:marked
81-
If you don't see **My First Angular App**, make sure you've entered all the code correctly,
90+
If you don't see **Hello Angular!**, make sure you've entered all the code correctly,
8291
in the [proper folders](#wrap-up),
8392
and run `pub get`.
8493

@@ -160,7 +169,7 @@ block server-watching
160169

161170
.alert.is-important
162171
:marked
163-
Be sure to terminate the `pub serve` process once you stop working on this app.
172+
Be sure to terminate your local server once you stop working on this app.
164173

165174
block project-file-structure
166175
.filetree

public/docs/ts/latest/quickstart.jade

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,13 @@ block includes
44
- var _prereq = 'Node.js and npm'
55
- var _angular_browser_uri = '@angular/platform-browser-dynamic'
66
- var _angular_core_uri = '@angular/core'
7-
- var _stepInit = 3 // Step # after NgModule step
7+
- var _stepInit = 4 // Step # after NgModule step
88
- var _quickstartSrcURL='https://github.com/angular/quickstart/blob/master/README.md'
99

1010
//- TS/Dart shared step counter
1111
- var step = _stepInit
1212

13-
.callout.is-helpful
14-
header Don't want #{_Lang}?
15-
p.
16-
Although you're getting started in #{_Lang}, you can also write Angular applications
17-
in JavaScript and #{_docsFor == 'ts' ? 'Dart' : 'TypeScript'}. Use the language selector in the
18-
left nav to switch development languages for this guide.
19-
.l-main-section
20-
h1 Overview
21-
13+
+ifDocsFor('ts')
2214
aside.is-right
2315
:marked
2416
The live example link opens the finished application in
@@ -35,16 +27,18 @@ figure.image-display
3527
:marked
3628
**Try it out**. Here's a link to a <live-example></live-example>.
3729

38-
You can also <a href="https://github.com/angular/quickstart/blob/master/README.md" target="_blank">
30+
+ifDocsFor('ts')
31+
:marked
32+
You can also <a href="!{_quickstartSrcURL}" target="_blank">
3933
clone the entire QuickStart application</a> from GitHub.
4034

41-
h2 Build this application!
35+
h1 Build this application!
4236

4337
:marked
4438
- [Prerequisite](#prereq): Install #{_prereq}.
4539
- [Step 1](#create-and-configure): Create and configure the project.
46-
<span if-docs="ts"><li>[Step 2](#ngmodule): Create your application.</span>
47-
- [Step !{step++}](#root-component): Create a component and add it to your application.
40+
- [Step 2](#ngmodule): Create your application.
41+
<li if-docs="ts">[Step 3](#root-component): Create a component and add it to your application.</li>
4842
- [Step !{step++}](#main): Start up your application.
4943
- [Step !{step++}](#index): Define the web page that hosts the application.
5044
- [Step !{step++}](#build-and-run): Build and run the application.
@@ -54,7 +48,7 @@ h2 Build this application!
5448
- var step = _stepInit // reinitialize step counter for headers to come
5549

5650
.l-main-section#prereq
57-
h1 Prerequisite: Install #{_prereq}
51+
h2 Prerequisite: Install #{_prereq}
5852

5953
block setup-tooling
6054
:marked
@@ -64,7 +58,7 @@ block setup-tooling
6458
in a terminal window.
6559

6660
.l-main-section
67-
h1#create-and-configure Step 1: Create and configure the project
61+
h2#create-and-configure Step 1: Create and configure the project
6862

6963
- var _package_and_config_files = _docsFor == 'dart' ? 'pubspec.yaml' : 'configuration files'
7064

@@ -74,7 +68,7 @@ h1#create-and-configure Step 1: Create and configure the project
7468
* [Create #{_package_and_config_files}](#add-config-files)
7569
* [#{_Install} packages](#install-packages)
7670

77-
h2 Create the project folder
71+
h3 Create the project folder
7872
:marked
7973
Using a terminal window, create a directory for the project, and change into this
8074
directory.
@@ -84,7 +78,7 @@ code-example(language="sh" class="code-shell").
8478
mkdir angular!{_}quickstart
8579
cd angular!{_}quickstart
8680

87-
h2#add-config-files Create #{_package_and_config_files}
81+
h3#add-config-files Create #{_package_and_config_files}
8882
block package-and-config-files
8983
- var _tsconfigUri = 'guide/typescript-configuration.html#tsconfig'
9084

@@ -130,7 +124,7 @@ block package-and-config-files
130124
Webpack: an Introduction</a>. Or, learn more about SystemJS configuration in general <a href="https://github.com/systemjs/systemjs/blob/master/docs/config-api.md" target="_blank">here</a>.
131125

132126

133-
h2#install-packages #{_Install} packages
127+
h3#install-packages #{_Install} packages
134128
block install-packages
135129
:marked
136130
Using npm from the command line, install the packages listed in `package.json` with the command:
@@ -154,22 +148,25 @@ block install-packages
154148

155149
:marked
156150
You're now ready to write some code!
157-
+ifDocsFor('ts')
151+
158152
.l-main-section
159-
h1#ngmodule Step 2: Create your application
153+
h2#ngmodule Step 2: Create your application
154+
155+
block create-your-app
160156
:marked
161157
You compose Angular applications into closely related blocks of functionality with
162158
[NgModules](guide/ngmodule.html). Angular itself is split into separate Angular Modules. This
163159
makes it possible for you to keep payload size small by only importing the parts of Angular
164160
that your application needs.
165161

166162
Every Angular application has at least one module: the _root module_, named `AppModule` here.
167-
163+
:marked
168164
**Create #{_an} #{_appDir} subfolder** off the project root directory:
169165

170166
code-example.code-shell.
171167
mkdir #{_appDir}
172168

169+
+ifDocsFor('ts')
173170
:marked
174171
Create the file `app/app.module.ts` with the following content:
175172

@@ -193,26 +190,27 @@ block install-packages
193190
[Tour of Heroes Tutorial](./tutorial/).
194191

195192
.l-main-section
196-
h1#root-component Step !{step++}: Create a component and add it to your application
193+
h2#root-component Step 3: Create a component and add it to your application
194+
197195
:marked
198196
Every Angular application has at least one component: the _root component_, named `AppComponent`
199197
here.
200198

201199
Components are the basic building blocks of Angular applications. A component controls a portion
202200
of the screen&mdash;a *view*&mdash;through its associated template.
203201

204-
a#app-component
205-
p.
206-
#[b Create the component file]
207-
#[code #[+adjExPath('app/app.component.ts')]] with the following content:
202+
#app-component
203+
:marked
204+
**Create the component file** <span ngio-ex>app/app.component.ts</span> with the following content:
208205

209206
+makeExample('app/app.component.ts')
210207

208+
- var _decorator_function = _docsFor == 'dart' ? 'annotation' : 'decorator function';
211209
:marked
212210
The QuickStart application has the same essential structure as any other Angular component:
213211

214212
* **An import statement**. Importing gives your component access to
215-
Angular's core [`@Component` decorator function](../latest/api/core/index/Component-decorator.html).
213+
Angular's core [`@Component` !{_decorator_function}](./api/core/index/Component-decorator.html).
216214
* **A @Component #{_decorator}** that associates *metadata* with the
217215
`AppComponent` component class:
218216

@@ -222,17 +220,18 @@ p.
222220
* **A component class** that controls the appearance and behavior of a view
223221
through its template. Here, you only have the root component, `AppComponent`. Since you don't
224222
need any application logic in the simple QuickStart example, it's empty.
225-
223+
+ifDocsFor('ts')
224+
:marked
226225
You *export* the `AppComponent` class so that you can *import* it into the application that you
227226
just created.
228227

229228
Edit the file `app/app.module.ts` to import your new `AppComponent` and add it in the
230229
declarations and bootstrap fields in the `NgModule` decorator:
231230

232-
+makeExample('app/app.module.ts', null, title='app/app.module.ts')
231+
+makeExample('app/app.module.ts')
233232

234233
.l-main-section
235-
h1#main Step !{step++}: Start up your application
234+
h2#main Step !{step++}: Start up your application
236235

237236
block create-main
238237
:marked
@@ -267,15 +266,15 @@ block create-main
267266
to that platform.
268267

269268
.l-main-section
270-
h1#index Step !{step++}: Define the web page that hosts the application
269+
h2#index Step !{step++}: Define the web page that hosts the application
271270
:marked
272271
In the *#{_indexHtmlDir}* folder,
273272
create an `index.html` file and paste the following lines into it:
274273

275274
+makeExample('index.html')
276275

277276

278-
+ifDocsFor('ts')
277+
block commentary-on-index-html
279278
:marked
280279
The noteworthy sections here are:
281280

@@ -284,11 +283,12 @@ h1#index Step !{step++}: Define the web page that hosts the application
284283
* Configuration file for `SystemJS`, and a script
285284
where you import and run the `app` module which refers to the `main` file that you just
286285
wrote.
287-
* The [`<my-app>`](#my-app) tag in the `<body>` which is *where your app lives!*
286+
* The `<my-app>` tag in the `<body>` which is *where your app lives!*
288287

289288

290289
:marked
291-
## Add some style
290+
### Add some style
291+
292292
Styles aren't essential, but they're nice, and `index.html` assumes that you have
293293
a stylesheet called `styles.css`.
294294

@@ -303,7 +303,7 @@ h1#index Step !{step++}: Define the web page that hosts the application
303303
see [styles.css](https://github.com/angular/angular.io/blob/master/public/docs/_examples/_boilerplate/styles.css).
304304

305305
.l-main-section#build-and-run
306-
h1 Step !{step++}: Build and run the application
306+
h2 Step !{step++}: Build and run the application
307307
block run-app
308308
:marked
309309
Open a terminal window and enter this command:
@@ -330,19 +330,19 @@ block build-app
330330
//- Nothing for ts.
331331
332332
.l-main-section#make-changes
333-
h1 Step !{step++}: Make some live changes
333+
h2 Step !{step++}: Make some live changes
334334
:marked
335-
Try changing the message in `app/app.component.ts` to "Hello Again Angular!".
335+
Try changing the message in <span ngio-ex>app/app.component.ts</span> to "Hello Again Angular!".
336+
336337
block server-watching
337338
:marked
338339
The TypeScript compiler and `lite-server` will detect your change, recompile the TypeScript into JavaScript,
339340
refresh the browser, and display your revised message.
340341

341-
342342
Close the terminal window when you're done to terminate both the compiler and the server.
343343

344344
.l-main-section
345-
h1#wrap-up Wrap up and next steps
345+
h2#wrap-up Wrap up and next steps
346346
:marked
347347
The final project folder structure looks like this:
348348
block project-file-structure

0 commit comments

Comments
 (0)