我正在将Angular 2应用程序从RC5升级到RC7。 @ angular / forms 包版本是0.3.0,我找不到更新版本。
尽管如此,在2.0.0-rc.6中,Type
声明已被弃用,转而使用Type<T>
。但看起来表单包需要更新,就像现在构建时出现了一堆错误,如:
错误在[默认] path/to/my/project/node_modules/@angular/forms/src/directives.d.ts:26:45 通用类型“类型”需要1个类型的参数。
有没有人知道是否有更新版本的表单包?通过列出npm show @angular/forms@* version
似乎不是:
@angular/forms@0.1.0 '0.1.0'
@angular/forms@0.1.1 '0.1.1'
@angular/forms@0.2.0 '0.2.0'
@angular/forms@0.3.0 '0.3.0'
还有其他解决方法吗?虽然是所有候选版本,但似乎很奇怪,这样一个关键的软件包已经留下了2个RC版本。
TA
答案 0 :(得分:0)
确保 RC7 您有以下 package.json 文件
{
"name": "angular2-quickstart",
"version": "1.0.0",
"scripts": {
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
"lite": "lite-server",
"postinstall": "typings install",
"tsc": "tsc",
"tsc:w": "tsc -w",
"typings": "typings"
},
"license": "ISC",
"dependencies": {
"@angular/common": "2.0.0-rc.7",
"@angular/compiler": "2.0.0-rc.7",
"@angular/core": "2.0.0-rc.7",
"@angular/forms": "2.0.0-rc.7",
"@angular/http": "2.0.0-rc.7",
"@angular/platform-browser": "2.0.0-rc.7",
"@angular/platform-browser-dynamic": "2.0.0-rc.7",
"@angular/router": "3.0.0-rc.3",
"@angular/upgrade": "2.0.0-rc.7",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.12",
"systemjs": "0.19.27",
"zone.js": "^0.6.21",
"angular2-in-memory-web-api": "0.0.19",
"bootstrap": "^3.3.6"
},
"devDependencies": {
"concurrently": "^2.2.0",
"lite-server": "^2.2.2",
"typescript": "^1.8.10",
"typings":"^1.3.2"
}
}