我正在运行 rc.2,但使用新的组件路由器。https://angular.io/docs/ts/latest/guide/router.html。这是 package.json
"dependencies": {
"@angular/common": "^2.0.0-rc.2",
"@angular/compiler": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2",
"@angular/http": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/router": "3.0.0-alpha.6",
"@angular/upgrade": "2.0.0-rc.2",
"systemjs": "0.19.31",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"angular2-in-memory-web-api": "0.0.12",
"bootstrap": "^3.3.6",
"contentful": "3.3.14"
}
我正在使用 alpha6,因为我没有让 alpha7 工作。无论如何,如果你在一个项目中开始新的,我会选择新的组件路由器。开发人员甚至推荐它:http ://angularjs.blogspot.ch/2016/06/improvements-coming-for-routing-in.html