|
1 | | -# Angular 2 Quickstart |
| 1 | +# Angular 2 QuickStart Source |
2 | 2 |
|
3 | | -The Angular 2 quickstart includes all of the dependencies for writing Angular 2 in your browser. |
| 3 | +This repository holds the TypeScript source code of the [angular.io quickstart](https://angular.io/docs/ts/latest/quickstart.html), |
| 4 | +the foundation for most of the documentation samples and potentially a good starting point for your application. |
4 | 5 |
|
5 | | -The quickstart contains |
6 | | - - Pre-built ES5 version of [Angular 2](https://www.npmjs.com/package/angular2) alpha-14 |
7 | | - - Pre-built ES5 version of [rtts-assert](https://www.npmjs.com/package/rtts-assert) alpha-7 |
8 | | - - The es6-shim, which includes Traceur, ES6 Module Loader, System, Zone, and Traceur options for meta-data annotations. |
| 6 | +## Create a new project based on the QuickStart |
| 7 | + |
| 8 | +Clone this repo into new project folder (e.g., `my-proj`). |
| 9 | +```bash |
| 10 | +$ git clone https://github.com/angular/quickstart my-proj |
| 11 | +$ cd my-proj |
| 12 | +``` |
| 13 | + |
| 14 | +We have no intention of updating the source on `angular/quickstart`. |
| 15 | +Discard everything "git-like" by deleting the `.git` folder. |
| 16 | +```bash |
| 17 | +$ rm -rf .git |
| 18 | +``` |
| 19 | + |
| 20 | +### Create a new git repo |
| 21 | +You could [start writing code](#start-development) now and throw it all away when you're done. |
| 22 | +If you'd rather preserve your work under source control, consider taking the following steps. |
| 23 | + |
| 24 | +Initialize this project as a *local git repo* and make the first commit: |
| 25 | +```bash |
| 26 | +$ git init |
| 27 | +$ git add . |
| 28 | +$ git commit -m "Initial commit" |
| 29 | +``` |
| 30 | + |
| 31 | +Create a *remote repository* for this project on the service of your choice. |
| 32 | + |
| 33 | +Grab its address (e.g. *`https://github.com/<my-org>/my-proj.git`*) and push the *local repo* to the *remote*. |
| 34 | +```bash |
| 35 | +$ git remote add origin <repo-address> |
| 36 | +$ git push -u origin master |
| 37 | +``` |
| 38 | +### Start development |
| 39 | + |
| 40 | +Install the npm packages described in the `package.json` and verify that it works: |
| 41 | + |
| 42 | +```bash |
| 43 | +$ npm install |
| 44 | +$ npm start |
| 45 | +``` |
| 46 | +You're ready to write your application. |
| 47 | + |
| 48 | +Remember the npm scripts in `package.json`: |
| 49 | + |
| 50 | +* `npm start` - runs the compiler and a server at the same time, both in "watch mode". |
| 51 | +* `npm run tsc` - runs the TypeScript compiler once. |
| 52 | +* `npm run tsc:w` - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them. |
| 53 | +* `npm run lite` - runs the [lite-server](https://www.npmjs.com/package/lite-server), a light-weight, static file server, written and maintained by [John Papa](John Papa) with excellent support for Angular apps that use routing. |
| 54 | +* `npm run typings` - runs the typings tool. |
| 55 | +* `npm run postinstall` - called by *npm* automatically *after* it successfully completes package installation. This script installs the TypeScript definition files this app requires. |
0 commit comments