我試圖讓我的angular2應用路由我只是試圖按照this linknode_modules/@角/路由器/索引「」沒有出口成員‘路線’
但在行app.routing.ts
:。
import { Routes, RouterModule } from '@angular/router';
它與抱怨:
node_modules/@angular/router/index"' has no exported member 'Routes'.
和
node_modules/@angular/router/index"' has no exported member 'RouterModule'.
這裏是我的package.json
文件:
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "^3.0.0-alpha.7",
"es6-shim": "0.35.1",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.26",
"zone.js": "0.6.12"
},
正如你看到的,我使用"@angular/router": "^3.0.0-alpha.7",
,但它並不能幫助我。
此外,如果OP不想升級到RC.5,現在他們應該將'Routes'更改爲'RouterConfig'並擺脫'RoutesModule' – peppermcknight