You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
When using Windows, Angular-CLI commands that involve building the application need an administrator prompt. This is because the CLI build step makes heavy usage of symlinks and in Windows those require admin rights.
79
+
_Windows Developers_: perform these commands in a console window opened as an administrator.
80
+
The Angular-CLI build steps create symlinks which require administrator rights under Windows.
81
81
82
82
.l-verbose-section
83
83
:marked
84
-
talk about serve
84
+
talk about the server
85
85
86
86
:marked
87
87
Now we're ready to write some code... or are we? We certainly could start writing code right now, but our tests would break.
88
88
89
89
:marked
90
90
### Tests?
91
91
92
-
What tests? Why, the ones the ones that Angular-CLI created with the initial project! They are configured to run on [Google Chrome](https://www.google.com/chrome/) so make sure to have it installed before running them.
92
+
What tests? The Angular-CLI created tests for our initial project!
93
+
They are configured to run on [Google Chrome](https://www.google.com/chrome/) so make sure it is installed before running them.
93
94
94
-
To run the end-to-end tests, we leave the current `ng serve` console running, open a new prompt and type `ng e2e`. We should see a the following output after a few console messages:
95
+
Open a new terminal (or console) window and run the *end-to-end (e2e)* tests with the command: `ng e2e`.
96
+
Look for the following output after a few console messages:
95
97
code-example(format="").
96
-
(...)
97
98
Spec started
98
99
99
100
angular2-cli-quickstart App
@@ -104,16 +105,16 @@ code-example(format="").
104
105
:marked
105
106
Looks all green and good. Always a good sign.
106
107
107
-
Now we run our unit tests once via `ng test --build=false --watch=false`, and we should see a similar message:
108
+
Keep the server running in the original window and run the *unit tests* with the command: `ng test --build=false --watch=false`.
109
+
After more console output, we should see a message like this:
It's always a good idea to run tests before and after making changes, that way we can guarantee that our apps behave the way we expect them to.
115
+
It's a good idea to run tests before and after making changes to confirm that our app behaves as we expect it to.
115
116
116
-
*Now* we're ready to start coding.
117
+
*At last* we are ready to write some code.
117
118
118
119
.l-verbose-section
119
120
:marked
@@ -126,20 +127,21 @@ code-example(format="").
126
127
a(id="edit")
127
128
.l-main-section
128
129
:marked
129
-
## Edit our app
130
+
## Edit the app
130
131
131
-
It's time to make this project more our own. We begin by opening `angular2-cli-quickstart` in our favourite editor.
132
+
We open the `angular2-cli-quickstart` projecd folder in our favourite editor.
132
133
133
-
Our root component is named after the project, and since we initialized the project with the name `angular2-cli-quickstart`, our root component is `Angular2CliQuickstartApp` and can be found in `src/app/angular2-cli-quickstart.component.ts`
134
+
The root component is named after the project. We created the project with the name `angular2-cli-quickstart`,
135
+
so our root component is `Angular2CliQuickstartApp` and can be found in `src/app/angular2-cli-quickstart.component.ts`
Run our tests again and... all green! We are back in business.
@@ -190,53 +195,66 @@ code-example(format="").
190
195
a(id="github-pages")
191
196
.l-main-section
192
197
:marked
193
-
### Pushing to production
198
+
## Push to production (Optional)
194
199
195
-
We now have a fully featured app marked green on all tests. Next stop: the production environment.
200
+
Next stop: the production environment.
196
201
197
202
Angular-CLI has a nifty command that helps us push our app onto [GitHub Pages](https://pages.github.com/) hosting.
198
203
199
-
To begin we'll need to [create a GitHub Account](https://github.com/join) if we don't have one already.
200
-
Afterwards we'll also need to [setup SSH keys on github](https://help.github.com/articles/generating-an-ssh-key/) if we haven't yet.
201
-
202
-
After that's done, run `ng github-pages:deploy`.
204
+
.l-sub-section
205
+
:marked
206
+
[Create a free GitHub Account](https://github.com/join) if you don't have one.
207
+
and [setup SSH keys](https://help.github.com/articles/generating-an-ssh-key/)
208
+
if you haven't done that.
209
+
:marked
210
+
Close all windows/processes (like `ng serve`!) that are using the app files and folders.
211
+
212
+
Run `ng github-pages:deploy`.
203
213
204
214
.alert.is-important
205
215
:marked
206
-
The `ng github-pages:deploy` command will perform a series of git operations that will add and remove files. Make sure you close all windows/processes (like `ng serve`!) that are using the app files and folders, otherwise these git operations might fail.
207
-
208
-
If that happens, we might be left in the `gh-pages` branch instead of the `master` branch. Simply `git checkout master`, close open windows that might be using these files, and try `ng github-pages:deploy`.
216
+
The `ng github-pages:deploy` command performs a series of git operations that add and remove files.
217
+
It can fail if those files are held by another process.
218
+
219
+
If the command fails, we might be left in the `gh-pages` branch instead of the `master` branch.
209
220
221
+
Run `git branch` and look for the _starred_ branch name.
222
+
If it isn't `master`, run `git checkout master`,
223
+
close open windows that might be using these files, and try `ng github-pages:deploy` again.
224
+
210
225
:marked
211
-
The first time we run this command, it will create a github repository. Every other time we call it, it will use the existing one.
226
+
This command creates a new github repository the first time we run it.
227
+
Subsequent calls use this existing repo.
212
228
213
-
The console will prompt us to get a github token that will allow the CLI to create a repo for us - don't worry, it will only be used once and we can safely delete it after the repo is created. Deleting it will invalidate it.
229
+
The command prompts us for a github token that will allow the CLI to create a repo for us.
230
+
Don't worry, the token is used only once and we can safely delete it after the repo is created.
231
+
Deleting the token invalidates it.
214
232
215
-
First go to [https://github.com/settings/tokens](https://github.com/settings/tokens), and click `Generate new token`.
233
+
### Get a token
234
+
Go to [https://github.com/settings/tokens](https://github.com/settings/tokens), and click *Generate new token*.
216
235
217
236
figure.image-display
218
237
img(src='/resources/images/devguide/cli-quickstart/gh-token-1.png'alt="Generate new token")
219
238
220
239
:marked
221
-
Github will ask us to login again, and afterwards we can choose a description and scope for the token.
240
+
We must login again and then choose a description and scope for the token.
222
241
223
-
Name the token `angular-cli`, chose as scope `public_repo` and then `Generate token` at the bottom.
242
+
Name the token `angular-cli`, chose as scope *public_repo*, and then click *Generate token* at the bottom.
224
243
figure.image-display
225
244
img(src='/resources/images/devguide/cli-quickstart/gh-token-2.png'alt="Description and scope")
226
245
227
246
:marked
228
247
On the next screen, copy the token, paste it in the console window that asked us for the token, and press enter.
229
248
230
-
Keep this page open so that at the end we can delete the token.
249
+
Keep this page open so we can delete the token when we're done.
231
250
figure.image-display
232
251
img(src='/resources/images/devguide/cli-quickstart/gh-token-3.png'alt="Copy and delete")
233
252
234
253
:marked
235
-
The console will also ask us for our github username, and afterwards will create the repository, build our app and deploy it as a Github Page.
236
-
237
-
The whole process should look like this:
254
+
The command prompts for our github username. Then it creates the repository, builds the app, and deploys it as a Github Page.
255
+
The entire process we just described looks like this:
0 commit comments