Angular2定义文件错误

时间:2016-05-12 14:26:07

标签: typescript angular

使用TypeScript 1.8.10编译器针对AngularJS 2.0 RC1编译应用程序时出现以下错误。

ERROR in [default] [...]/www/node_modules/@angular/testing/src/mock/mock_application_ref.d.ts:6:
Generic type 'ComponentRef<C>' requires 1 type argument(s).

ERROR in [default] [...]/www/node_modules/@angular/testing/src/mock/mock_application_ref.d.ts:8:
Generic type 'ComponentFactory<C>' requires 1 type argument(s).

ERROR in [default] [...]/www/node_modules/@angular/testing/src/mock/mock_application_ref.d.ts:8:
Generic type 'ComponentRef<C>' requires 1 type argument(s).

ERROR in [default] [...]/www/node_modules/@angular/testing/src/mock/schema_registry_mock.d.ts:2:
Class 'MockSchemaRegistry' incorrectly implements interface 'ElementSchemaRegistry'.
  Property 'securityContext' is missing in type 'MockSchemaRegistry'.

ERROR in [default] [...]/www/node_modules/@angular/testing/src/test_component_builder.d.ts:26:18
Generic type 'ComponentRef<C>' requires 1 type argument(s).

ERROR in [default] [...]/www/node_modules/@angular/testing/src/test_component_builder.d.ts:31:30
Generic type 'ComponentRef<C>' requires 1 type argument(s).

怎么了?

1 个答案:

答案 0 :(得分:3)

尝试将所有导入from '@angular/testing';更改为from '@angular/core/testing';

这对我有用;)