PrimeNg 数据表错误

PrimeNg DataTables Error

一直在尝试通过关注 https://www.primefaces.org/primeng/#/datatable 让数据表正常工作。当我在 4 时,这似乎是为 Angular 2 设置的,但我试图使其与 4 兼容。所以我的主要问题是:

这可以修复吗?PrimeNG 网站上是否有 angular 4 版本?可以修复吗,需要做什么?

Git 这里:https://github.com/BillyCharter87/Tech-O-Dex-UI/tree/PrimeNGTable

谢谢,

此处出错

>     Uncaught Error: Template parse errors:
>     'app-table' is not a known element:
>     1. If 'app-table' is an Angular component, then verify that it is part of this module.
>     2. If 'app-table' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component
> to suppress this message. ("
>     <app-userform></app-userform>
>     
>     [ERROR ->]<app-table></app-table>
>     "): ng:///AppModule/AppComponent.html@10:0
>         at syntaxError (compiler.js:486)
>         at TemplateParser.webpackJsonp.../../../compiler/esm5/compiler.js.TemplateParser.parse
> (compiler.js:24674)
>         at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._parseTemplate
> (compiler.js:34629)
>         at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileTemplate
> (compiler.js:34604)
>         at compiler.js:34505
>         at Set.forEach (<anonymous>)
>         at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileComponents
> (compiler.js:34505)
>         at compiler.js:34375
>         at Object.then (compiler.js:475)
>         at JitCompiler.webpackJsonp.../../../compiler/esm5/compiler.js.JitCompiler._compileModuleAndComponents
> (compiler.js:34374)

2 和 4 版本之间没有区别,可以改变这个错误并修复。该错误表明您在 <app-table> 尚未包含在任何活动模块中时尝试使用它。如果 <app-table> 是 PrimeNg 中的已知元素,则只需导入它在其中声明的模块,在 AppModule 中(或任何相关的模块,并且在想要使用该元素时正在使用)。

在您 link 了解到他们正在使用的整个文档中:<p-dataTable>,您确定这不是您想要的吗?同样在提供的 link 中,它指出 datatables 已被弃用,您应该改用 Turbo table。如果您实际上使用的是 Turbo table,那么正确的元素是:<p-table> 而不是 <app-table> (according to the documentation).