问题描述
我正在将Angular 2应用程序从RC5升级到RC7. @ angular/forms 软件包的版本是0.3.0,我找不到更新的软件包.
I'm in the process of upgrading an Angular 2 app from RC5 to RC7. @angular/forms package version is 0.3.0, and I could not find a newer one.
仍然,在2.0.0-rc.6中,不推荐使用Type
声明,而推荐使用Type<T>
.但是看来表单包需要更新,因为现在构建时出现了很多错误,例如:
Still, in 2.0.0-rc.6 the Type
declaration was deprecated in favour of Type<T>
. But it looks like forms package needs to be updated, as now when building I got a bunch of errors like:
有人知道是否有较新版本的Forms软件包吗?通过使用npm show @angular/forms@* version
列出,似乎不是:
Does anyone know if there's a newer version of forms package? By listing with npm show @angular/forms@* version
it seems not:
@angular/[email protected] '0.1.0'
@angular/[email protected] '0.1.1'
@angular/[email protected] '0.2.0'
@angular/[email protected] '0.3.0'
还有其他解决方法吗?尽管都是候选版本,但对于两个RC版本却留下了如此关键的软件包,这似乎很奇怪.
Is there any other workaround? Although being all release candidates, it seems strange that such a crucial package has been left behind for 2 RC versions.
TA
推荐答案
使用 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"
}
}
这篇关于Angular 2 RC7的哪个@ angular/forms版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!