使用表格角度:请确保它通过'files'或'include'属性在您的 tsconfig 中



我正在尝试使用Angular表格

@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',{read:viewContainerRef,static: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)

我该如何修复?

这只是一个疯狂的猜测,但是您可能正在尝试获得Angular 8来编译Angular 6-7包装。@Tabler/Angular最后一次更新于4月26日,在Angular在5月29日的上发行版之前。

自Angular 8以来,ViewContainerRef接口的定义已更改,现在static: boolean属性是所述接口的要求。

尝试将角度版本降级到7,它应该解决问题。

相关内容

最新更新