【问题标题】:Angular2 definition file errorsAngular2定义文件错误
【发布时间】:2016-09-08 11:07:37
【问题描述】:

使用 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).

怎么了?

【问题讨论】:

    标签: typescript angular


    【解决方案1】:

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

    这对我有用;)

    【讨论】:

      猜你喜欢
      • 2017-11-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-27
      • 2016-09-24
      • 2017-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多