使用tabler angular:请通过“ files”或“ include”属性确保它在您的tsconfig中

时间:2019-06-28 22:55:34

标签: angular

我正在尝试使用Angular Tabler

@tabler/angular-core
@tabler/angular-ui
@tabler/angular-styles
@tabler/angular-forms

在npm安装所有这些软件包并运行ng serve之后,我收到错误消息:

Argument of type '{ read: typeof ViewContainerRef; }' is not assignable to parameter of type '{ read?: any; static: boolean; }'.
  Property 'static' is missing in type '{ read: typeof ViewContainerRef; }' but required in type '{ read?: any; static: boolean; }'.ts(2345)

这可以通过更改horizontal.component.ts

中的对象来解决。
  

@ViewChild('fieldComponent',{阅读:ViewContainerRef,静态:false})

但是,现在ng serve,我遇到了以下问题:

ERROR in ./node_modules/@tabler/angular-core/index.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /Users/me/git//ngapp/node_modules/@tabler/angular-core/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format.
    at AngularCompilerPlugin.getCompiledFile (/Users/me/git/ngapp/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:838:23)
    at /Users/me/git//ngapp/node_modules/@ngtools/webpack/src/loader.js:41:31
    at processTicksAndRejections (internal/process/task_queues.js:89:5)

我该如何解决?

1 个答案:

答案 0 :(得分:0)

这只是一个疯狂的猜测,但是您可能正在尝试使Angular 8编译Angular 6-7软件包。 @ tabler / angular的最新更新于4月26日,而不是Angular的最新发布于5月29日。

自Angular 8开始,ViewContainerRef接口的定义已更改,现在该接口需要static: boolean属性。

尝试将Angular版本降级到7,这样可以解决问题。