1
1
block includes
2
2
include ../_util-fns
3
3
4
+ a#develop-locally
4
5
:marked
5
- ## Trying Angular
6
-
7
- Live coding [Quickstart](../quickstart.html) in the browser is a great way to explore Angular.
8
- Links on almost every documentation page will open completed samples in the browser where you can
9
- play with the code, share your changes with friends, and download and run the code on your own machine.
10
-
11
- As much fun as this is ...
12
- * you can't ship your app in plunker
13
- * you aren't always online when writing code
14
- * transpiling TypeScript in the browser is slow
15
- * the type support, refactoring, and code completion only work in your local IDE
16
-
17
6
## Setup a local development environment
7
+ The <live-example name=quickstart>QuickStart live-coding</live-example> example is an Angular _playground_.
8
+ It's not where you'd develop a real application.
9
+ You [should develop locally](#why-locally "Why develop locally") on your own machine ... and that's also how we think you should learn Angular.
18
10
19
- Fortunately, setting up a new project in your local development environment is quick and easy
20
- with the [**QuickStart seed**](https://github.com/angular/quickstart "Install the github QuickStart repo"),
21
- a repository on github.
11
+ Setting up a new project on your machine is quick and easy with the **QuickStart seed**,
12
+ maintained [on github](https://github.com/angular/quickstart "Install the github QuickStart repo").
22
13
23
14
Make sure you have [node and npm installed](#install-node "What if you don't have node?").
24
15
Then ...
25
- 1. [clone](#clone) or [download](#download) the **QuickStart seed repository**.
26
- 1. [install the `npm` packages](#install-node "What if you don't have node?")
27
- 1. run `npm start` to launch the sample application
16
+ 1. Create a project folder (you can call it <span ngio-ex>quickstart</span> and rename it later).
17
+ 1. [Clone](#clone "Clone it from github") or [download](#download "download it from github") the **QuickStart seed** into your project folder.
18
+ 1. [Install the _npm_ packages](#install-node "What if you don't have node?").
19
+ 1. Run `npm start` to launch the sample application.
28
20
29
21
a#clone
30
22
:marked
@@ -33,8 +25,8 @@ a#clone
33
25
Perform the _clone-to-launch_ steps with these terminal commands.
34
26
35
27
code-example( language ="sh" class ="code-shell" ) .
36
- git clone https://github.com/angular/quickstart.git my-project
37
- cd my-project
28
+ git clone https://github.com/angular/quickstart.git quickstart
29
+ cd quickstart
38
30
npm install
39
31
npm start
40
32
@@ -45,15 +37,15 @@ a#download
45
37
and unzip it into your project folder. Then perform the remaining steps with these terminal commands.
46
38
47
39
code-example( language ="sh" class ="code-shell" ) .
48
- cd my-project
40
+ cd quickstart
49
41
npm install
50
42
npm start
51
43
52
44
.l-main-section
53
45
:marked
54
- ## What's different about the QuickStart seed?
46
+ ## What's in the QuickStart seed?
55
47
56
- The QuickStart seed contains the same application as the <live-example name="quickstart">QuickStart live example </live-example>.
48
+ The ** QuickStart seed** contains the same application as the <live-example name="quickstart">QuickStart _playground_ </live-example>.
57
49
But there are _many more files_ in the project folder on your machine,
58
50
most of which you can [learn about later](setup-systemjs-anatomy.html "Setup Anatomy").
59
51
@@ -76,12 +68,7 @@ code-example(language="sh" class="code-shell").
76
68
app/main.ts
77
69
` )( format ='.' )
78
70
:marked
79
- The [QuickStart](../quickstart.html "Angular QuickStart") sample only shows the `AppComponent` file.
80
- It creates the equivalent of `app.module.ts` and `main.ts` internally _for that example only_
81
- so the reader can discover Angular without distraction.
82
-
83
- All other guides and cookbooks expect you to have defined these three files explicitly.
84
- Each file has a distinct purpose and evolves independently as the application grows.
71
+ All guides and cookbooks have _at least these three files_. Each file has a distinct purpose and evolves independently as the application grows.
85
72
86
73
style td, th {vertical-align: top}
87
74
table( width ="100%" )
@@ -94,31 +81,34 @@ table(width="100%")
94
81
td <code >app.component.ts</code >
95
82
td
96
83
:marked
97
- Defines the same `AppComponent` as the one in the [QuickStart](../quickstart.html).
84
+ Defines the same `AppComponent` as the one in the [QuickStart](../quickstart.html) playground .
98
85
It is the **root** component of what will become a tree of nested components
99
86
as the application evolves.
100
87
tr
101
88
td <code >app.module.ts</code >
102
89
td
103
90
:marked
104
- Defines `AppModule`, the [root module](appmodule.html) that tells Angular how to assemble the application.
91
+ Defines `AppModule`, the [root module](appmodule.html "AppModule: the root module" ) that tells Angular how to assemble the application.
105
92
Right now it declares only the `AppComponent`.
106
93
Soon there will be more components to declare.
107
94
tr
108
95
td <code >main.ts</code >
109
96
td
110
97
:marked
111
98
Compiles the application with the [JiT compiler](../glossary.html#jit)
112
- and [bootstraps](appmodule.html#main) the application to run in the browser.
99
+ and [bootstraps](appmodule.html#main "bootstrap the application" ) the application to run in the browser.
113
100
That's a reasonable choice for the development of most projects and
114
101
it's the only viable choice for a sample running in a _live-coding_ environment like Plunker.
115
102
You'll learn about alternative compiling and deployment options later in the documentation.
116
103
117
- .l-main-section
118
- :marked
119
- ## Next Step
104
+ .l-sub-section
105
+ :marked
106
+ ### Next Step
107
+
108
+ If you're new to Angular, we recommend staying on the [learning path](learning-angular.html).
120
109
121
- If you're new to Angular, try the recommended [learning path](learning-path.html).
110
+ br
111
+ br
122
112
123
113
a#install-node
124
114
.l-main-section
@@ -140,3 +130,31 @@ a#install-node
140
130
You may need [nvm](https://github.com/creationix/nvm) if you already have projects running on your machine that
141
131
use other versions of node and npm.
142
132
133
+ a#why-locally
134
+ .l-main-section
135
+ :marked
136
+ ## Appdendix: Why develop locally
137
+
138
+ <live-example>Live coding</live-example> in the browser is a great way to explore Angular.
139
+
140
+ Links on almost every documentation page open completed samples in the browser.
141
+ You can play with the sample code, share your changes with friends, and download and run the code on your own machine.
142
+
143
+ The [QuickStart](../quickstart.html "Angular QuickStart Playground") shows just the `AppComponent` file.
144
+ It creates the equivalent of `app.module.ts` and `main.ts` internally _for the playground only_.
145
+ so the reader can discover Angular without distraction.
146
+ The other samples are based on the QuickStart seed.
147
+
148
+ As much fun as this is ...
149
+ * you can't ship your app in plunker
150
+ * you aren't always online when writing code
151
+ * transpiling TypeScript in the browser is slow
152
+ * the type support, refactoring, and code completion only work in your local IDE
153
+
154
+ Use the <live-example><i>live coding</i></live-example> environment as a _playground_,
155
+ a place to try the documentation samples and experiment on your own.
156
+ It's the perfect place to reproduce a bug when you want to
157
+ <a href="https://github.com/angular/angular.io/issues/new" target="_blank" title="File a documentation issue">file a documentation issue</a> or
158
+ <a href="https://github.com/angular/angular/issues/new" target="_blank" title="File an Angular issue">file an issue with Angular itself</a>.
159
+
160
+ For real development, we strongly recommend [developing locally](#develop-locally).
0 commit comments