@angular / forms通用类型'Type <t>'需要1个类型的参数

时间:2016-09-01 18:39:18

标签: angular angular2-forms

我升级了Node和NPM并重新安装了Angular CLI(angular-cli: 1.0.0-beta.11-webpack.8, node: 6.5.0, os: linux x64),生成了一个工作正常的foo项目。然后我将Angular 2撞到RC.6并得到了这个错误:

jan@linux-zd16:~/src/fm-repos/foo> ng serve
ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:26:45 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:27:49 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:28:49 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:46:38 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:50:47 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives/select_multiple_control_value_accessor.d.ts:12:17 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:13:37 
Generic type 'Type<T>' requires 1 type argument(s).

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:18:46 
Generic type 'Type<T>' requires 1 type argument(s).
Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  2.81 kB       0       
webpack: bundle is now VALID.

任何想法如何解决?这是我的package.json

{   "name": "foo", "version": "0.0.0", "license": "MIT",   
    "angular-cli": {},
    "scripts": {
      "start": "ng serve",
      "lint": "tslint \"src/**/*.ts\"",
      "test": "ng test",
      "pree2e": "webdriver-manager update",
      "e2e": "protractor"},
    "private": true,
"dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/core": "2.0.0-rc.6",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "core-js": "^2.4.0",
    "rxjs": "5.0.0-beta.11",
    "ts-helpers": "^1.1.1",
    "zone.js": "0.6.12"},
"devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.11-webpack.8",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.3",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.0"}
}

1 个答案:

答案 0 :(得分:14)

@angular/form版本更新为2.0.0-rc.6。 Angular表单的版本现在与大多数其他@angular模块版本匹配。