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

Commit 5a7dec6

Browse files
committed
docs(quickstart): edit Dart & TS QuickStarts
1 parent ba47da0 commit 5a7dec6

File tree

2 files changed

+136
-119
lines changed

2 files changed

+136
-119
lines changed

public/docs/dart/latest/quickstart.jade

+33-19
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ block includes
77
- var _angular_browser_uri = 'package:angular2/platform/browser.dart'
88
- var _angular_core_uri = 'package:angular2/core.dart'
99
- var _appDir = 'lib'
10+
- var _anAppDir = 'a lib'
1011
- var _indexHtmlDir = 'web'
1112

1213
block setup-tooling
1314
:marked
1415
Install the **[Dart SDK](https://www.dartlang.org/downloads/)**,
1516
if not already on your machine, and any tools you like to use with Dart.
16-
The Dart SDK includes **[pub][pub]**, the Dart package manager, that we
17-
will be using shortly.
17+
The Dart SDK includes tools such as **[pub][pub]**, the Dart package manager.
1818
If you don't have a favorite Dart editor already, try
1919
[WebStorm][WS], which comes with a Dart plugin.
2020
You can also download [Dart plugins for other IDEs and editors][DT].
2121

2222
[WS]: https://confluence.jetbrains.com/display/WI/Getting+started+with+Dart
2323
[DT]: https://www.dartlang.org/tools
2424
[pub]: https://www.dartlang.org/tools/pub
25-
25+
2626
block download-source
2727
// exclude this section from Dart
2828
@@ -57,8 +57,8 @@ block create-main
5757
Now we need something to tell Angular to load the root component.
5858
Create:
5959
ul
60-
li a #[b folder named #[code web]], and inside it
61-
li the file #[code #[+adjExPath('app/main.ts')]] with the following content:
60+
li a #[b folder named #[code web]]
61+
li a file named #[code #[+adjExPath('app/main.ts')]] with the following content:
6262

6363
block index-html-commentary-for-ts
6464
//- N/A
@@ -76,7 +76,7 @@ block run-app
7676
and then run it by visiting <b><code>http://localhost:8080</code></b> in any modern browser.
7777
Pub serve generates JavaScript on the fly,
7878
which can take a while when you first visit the page.
79-
Pub serve also runs in <b><i>watch mode</i></b>, and will re-compile and subsequently serve
79+
Pub serve also runs in <b><i>watch mode</i></b>, and will recompile and subsequently serve
8080
and changed assets.
8181
p.
8282
Once the app is running, you should see the following in your browser
@@ -85,7 +85,7 @@ block run-app
8585
block build-app
8686
.alert.is-important
8787
:marked
88-
If you don't see that, make sure you've entered all the code correctly,
88+
If you don't see **My First Angular 2 App**, make sure you've entered all the code correctly,
8989
in the [proper folders](#wrap-up),
9090
and run `pub get`.
9191

@@ -105,6 +105,11 @@ block build-app
105105
- var stylePattern = { pnk: /(dart_to_js_script_rewriter.*$)|(- dart_to_js_script_rewriter.*$)/gm, otl: /(dependencies:)|(transformers:)/g };
106106
+makeExample('quickstart/dart/pubspec.yaml', null, 'pubspec.yaml', stylePattern)
107107

108+
.alert.is-important
109+
:marked
110+
The `dart_to_js_script_rewriter` transformer must be
111+
**after** the `angular2` transformer in `pubspec.yaml`.
112+
108113
p.
109114
Then compile your Dart code to JavaScript,
110115
using <code>pub build</code>.
@@ -115,7 +120,7 @@ block build-app
115120

116121
p.
117122
The generated JavaScript appears, along with supporting files,
118-
under the <code>build</code> directory.
123+
under a directory named <code>build</code>.
119124
p.
120125
When you generate JavaScript for an Angular app,
121126
be sure to use the Angular transformer.
@@ -148,30 +153,39 @@ block build-app
148153
(<code>entry_points</code> in <code>pubspec.yaml</code>)
149154
so that they don't use mirrors.
150155

151-
block server-watching
156+
block server-watching
152157
:marked
153-
Pub serve is watching and
154-
should detect the change, recompile the Dart into JavaScript,
155-
refresh the browser, and display the revised message.
156-
It's a nifty way to develop an application!
158+
To see the new version, just reload the page.
157159

158-
Ensure that you terminate the `pub serve` process once you are done.
160+
.alert.is-important
161+
:marked
162+
Be sure to terminate the `pub serve` process once you stop working on this app.
159163

160164
block project-file-structure
161165
.filetree
162166
.file angular2-quickstart
163167
.children
164-
.file build ...
165168
.file lib
166169
.children
167170
.file app_component.dart
168171
.file pubspec.yaml
169172
.file web
170173
.children
171174
.file index.html
172-
.file main.ts
175+
.file main.dart
173176
.file styles.css
174177

178+
.l-verbose-section
179+
:marked
180+
This figure doesn't show generated files and directories.
181+
For example, a `pubspec.lock` file
182+
specifies versions and other identifying information for
183+
the packages that our app depends on.
184+
The `pub build` command creates a `build` directory
185+
containing the JavaScript version of our app.
186+
Pub, IDEs, and other tools might create
187+
other directories and dotfiles.
188+
175189
block project-files
176190
+makeTabs(`
177191
quickstart/ts/app/app.component.ts,
@@ -180,10 +194,10 @@ block project-files
180194
quickstart/dart/pubspec.yaml,
181195
quickstart/ts/styles.1.css`
182196
,null,
183-
`app/app.component.ts,
184-
app/main.ts,
197+
`app/app.component.ts,
198+
app/main.ts,
185199
index.html,
186-
pubspec.yaml,
200+
pubspec.yaml,
187201
styles.css`)
188202

189203
block what-next-ts-overhead

0 commit comments

Comments
 (0)