been trying to get datatables to work by following https://www.primefaces.org/primeng/#/datatable. this seems to be setup for Angular 2 while I'm on 4, but I tried to make it compatible with 4. So my main question is:
Can this be fixed or is there an angular 4 version of this on PrimeNG site? is it can be fixed, what needs to be done?
Git here: https://github.com/BillyCharter87/Tech-O-Dex-UI/tree/PrimeNGTable
Thanks,
Error here
> 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)
There is no difference between the 2 & 4 version that would alter this error and fix. The error is stating that you are trying to use <app-table>
when it has not been included in any of the active modules. If <app-table>
is a known element from PrimeNg, then just import the module it is declared in, in AppModule
(or whatever module is relevant and in use at the time of wanting to use this element).
Throughout the entire documentatation that you linked to they are using: <p-dataTable>
, are you sure this isn't what you want? Also in the supplied link, it states that datatables is deprecated and you should be using Turbo table instead. If you are infact using Turbo table, then the correct element is: <p-table>
not <app-table>
(according to the documentation).