angular2.0--my first angular2 app
官网:https://angular.io
文档:https://angular.io/docs/ts/latest/
让我们从零开始,建立在TypeScript 的基础上build angular2 app
目录结构:
angular2-quickstart
|—app
|— app.component.ts
|—main.ts
|—index.html
|—license.md
正式开始:
前提条件: 已安装nodejs
下载地址:https://nodejs.org/en/
1.在你的工作目录下新建一个文件夹:
我的是: D:\test\angular2-quickstart
2.在该目录下新建一个package.json文件:
angular2-quickstart->package.json
代码如下:
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"tsc": "tsc",
"tsc:w": "tsc -w",
"lite": "lite-server",
"start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.2",
"systemjs": "0.19.6",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"zone.js": "0.5.10"
},
"devDependencies": {
"concurrently": "^1.0.0",
"lite-server": "^1.3.4",
"typescript": "^1.7.5"
}
}
3.命令行打开angular2-quickstart目录
输入:
npm install