- 创建目录angular2-app
- 添加tsconfig.json,typings.json,package.json
- cmd进入angular2-app,npm install
- angular2-app下创建app目录,添加app.compenent.ts,main.ts
- angular2-app下创建index.html
- angular2-app下,cmd运行:npm start
tsconfig.json
{ "compilerOptions": { "target": "es5", "module": "system", "moduleResolution": "node", "sourceMap": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "removeComments": false, "noImplicitAny": false }, "exclude": [ "node_modules", "typings/main", "typings/main.d.ts" ] }
typings.json
{ "ambientDependencies": { "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2" } }
package.json
{ "name": "angular2-quickstart", "version": "1.0.0", "scripts": { "start": "concurrent \"npm run tsc:w\" \"npm run lite\" ", "tsc": "tsc", "tsc:w": "tsc -w", "lite": "lite-server", "typings": "typings", "postinstall": "typings install" }, "license": "ISC", "dependencies": { "angular2": "2.0.0-beta.7", "systemjs": "0.19.22", "es6-promise": "^3.0.2", "es6-shim": "^0.33.3", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", "zone.js": "0.5.15" }, "devDependencies": { "concurrently": "^2.0.0", "lite-server": "^2.1.0", "typescript": "^1.7.5", "typings":"^0.6.8" } }
app.compenent.ts
System.register(['angular2/core'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1; var AppComponent; return { setters:[ function (core_1_1) { core_1 = core_1_1; }], execute: function() { AppComponent = (function () { function AppComponent() { } AppComponent = __decorate([ core_1.Component({ selector: 'my-app', template: '
My First Angular 2 App
' }), __metadata('design:paramtypes', []) ], AppComponent); return AppComponent; }()); exports_1("AppComponent", AppComponent); } } }); //# sourceMappingURL=app.component.js.mapmain.ts
System.register(['angular2/platform/browser', './app.component'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var browser_1, app_component_1; return { setters:[ function (browser_1_1) { browser_1 = browser_1_1; }, function (app_component_1_1) { app_component_1 = app_component_1_1; }], execute: function() { browser_1.bootstrap(app_component_1.AppComponent); } } }); //# sourceMappingURL=main.js.map
index.html