I’m submitting a … (check one with “x”)
[X ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
I get a run time error with the following error - ‘ngx-datatable’ is not a known element:
Expected behavior
Is that the application would render grid
Reproduction of the problem
I followed the direction on this page https://swimlane.gitbooks.io/ngx-datatable/content/introduction/getting-started.html to install the component.
What is the motivation / use case for changing the behavior?
Not sure if there is something I am doing wrong or if there is a bug
Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
IE, Chrome, FireFox - would expect same behavior from other browsers
Language:
TypeScript 2.0.3, Angular 4
Steps -
Had working running application
Used npm to download Angular 4
Used npm to download ngx-datatable
Followed the direction from here https://swimlane.gitbooks.io/ngx-datatable/content/introduction/getting-started.html to install the component.
Compiles but get the runtime error
Full Error:
Can’t bind to ‘rows’ since it isn’t a known property of ‘ngx-datatable’.
- If ‘ngx-datatable’ is an Angular component and it has ‘rows’ input, then verify that it is part of this module.
- If ‘ngx-datatable’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
- To allow any property add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. ("
</div> </div>-->
<ngx-datatable [ERROR ->][rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:19
Can’t bind to ‘columns’ since it isn’t a known property of ‘ngx-datatable’.
- If ‘ngx-datatable’ is an Angular component and it has ‘columns’ input, then verify that it is part of this module.
- If ‘ngx-datatable’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
- To allow any property add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. (" </div>-->
<ngx-datatable [rows]="rows"
[ERROR ->][columns]="columns">
</ngx-datatable>
</div>
"): ng:///AdminModule/AdminComponent.html@660:19
'ngx-datatable' is not a known element:
1. If 'ngx-datatable' is an Angular component, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</div>
</div>-->
[ERROR ->]<ngx-datatable [rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:4 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:
Can't bind to 'rows' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'rows' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>
</div>-->
<ngx-datatable [ERROR ->][rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:19
Can't bind to 'columns' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'columns' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>-->
<ngx-datatable [rows]="rows"
[ERROR ->][columns]="columns">
</ngx-datatable>
</div>
"): ng:///AdminModule/AdminComponent.html@660:19
'ngx-datatable' is not a known element:
1. If 'ngx-datatable' is an Angular component, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</div>
</div>-->
[ERROR ->]<ngx-datatable [rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:4
at syntaxError (http://localhost:8080/dist/app.bundle.js:56812:34) [<root>]
at TemplateParser.parse (http://localhost:8080/dist/app.bundle.js:66821:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:8080/dist/app.bundle.js:80539:39) [<root>]
at http://localhost:8080/dist/app.bundle.js:80463:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:8080/dist/app.bundle.js:80463:19) [<root>]
at createResult (http://localhost:8080/dist/app.bundle.js:80348:19) [<root>]
at Zone.run (http://localhost:8080/dist/app.bundle.js:107191:43) [<root> => <root>]
at http://localhost:8080/dist/app.bundle.js:107826:57 [<root>]
at Zone.runTask (http://localhost:8080/dist/app.bundle.js:107231:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:8080/dist/app.bundle.js:107659:35) [<root>] Error: Template parse errors:
Can't bind to 'rows' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'rows' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>
</div>-->
<ngx-datatable [ERROR ->][rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:19
Can't bind to 'columns' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'columns' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>-->
<ngx-datatable [rows]="rows"
[ERROR ->][columns]="columns">
</ngx-datatable>
</div>
"): ng:///AdminModule/AdminComponent.html@660:19
'ngx-datatable' is not a known element:
1. If 'ngx-datatable' is an Angular component, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</div>
</div>-->
[ERROR ->]<ngx-datatable [rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:4
at syntaxError (http://localhost:8080/dist/app.bundle.js:56812:34) [<root>]
at TemplateParser.parse (http://localhost:8080/dist/app.bundle.js:66821:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:8080/dist/app.bundle.js:80539:39) [<root>]
at http://localhost:8080/dist/app.bundle.js:80463:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:8080/dist/app.bundle.js:80463:19) [<root>]
at createResult (http://localhost:8080/dist/app.bundle.js:80348:19) [<root>]
at Zone.run (http://localhost:8080/dist/app.bundle.js:107191:43) [<root> => <root>]
at http://localhost:8080/dist/app.bundle.js:107826:57 [<root>]
at Zone.runTask (http://localhost:8080/dist/app.bundle.js:107231:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:8080/dist/app.bundle.js:107659:35) [<root>]
consoleError @ zone.js:569
handleUnhandledRejection @ zone.js:574
_loop_1 @ zone.js:609
drainMicroTaskQueue @ zone.js:613
zone.js:571 Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'rows' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'rows' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>
</div>-->
<ngx-datatable [ERROR ->][rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:19
Can't bind to 'columns' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'columns' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>-->
<ngx-datatable [rows]="rows"
[ERROR ->][columns]="columns">
</ngx-datatable>
</div>
"): ng:///AdminModule/AdminComponent.html@660:19
'ngx-datatable' is not a known element:
1. If 'ngx-datatable' is an Angular component, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</div>
</div>-->
[ERROR ->]<ngx-datatable [rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:4
Error: Template parse errors:
Can't bind to 'rows' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'rows' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>
</div>-->
<ngx-datatable [ERROR ->][rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:19
Can't bind to 'columns' since it isn't a known property of 'ngx-datatable'.
1. If 'ngx-datatable' is an Angular component and it has 'columns' input, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
</div>-->
<ngx-datatable [rows]="rows"
[ERROR ->][columns]="columns">
</ngx-datatable>
</div>
"): ng:///AdminModule/AdminComponent.html@660:19
'ngx-datatable' is not a known element:
1. If 'ngx-datatable' is an Angular component, then verify that it is part of this module.
2. If 'ngx-datatable' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
</div>
</div>-->
[ERROR ->]<ngx-datatable [rows]="rows"
[columns]="columns">
</ngx-datatable>
"): ng:///AdminModule/AdminComponent.html@659:4
at syntaxError (http://localhost:8080/dist/app.bundle.js:56812:34) [<root>]
at TemplateParser.parse (http://localhost:8080/dist/app.bundle.js:66821:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:8080/dist/app.bundle.js:80539:39) [<root>]
at http://localhost:8080/dist/app.bundle.js:80463:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:8080/dist/app.bundle.js:80463:19) [<root>]
at createResult (http://localhost:8080/dist/app.bundle.js:80348:19) [<root>]
at Zone.run (http://localhost:8080/dist/app.bundle.js:107191:43) [<root> => <root>]
at http://localhost:8080/dist/app.bundle.js:107826:57 [<root>]
at Zone.runTask (http://localhost:8080/dist/app.bundle.js:107231:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:8080/dist/app.bundle.js:107659:35) [<root>]
at syntaxError (http://localhost:8080/dist/app.bundle.js:56812:34) [<root>]
at TemplateParser.parse (http://localhost:8080/dist/app.bundle.js:66821:19) [<root>]
at JitCompiler._compileTemplate (http://localhost:8080/dist/app.bundle.js:80539:39) [<root>]
at http://localhost:8080/dist/app.bundle.js:80463:62 [<root>]
at Set.forEach (native) [<root>]
at JitCompiler._compileComponents (http://localhost:8080/dist/app.bundle.js:80463:19) [<root>]
at createResult (http://localhost:8080/dist/app.bundle.js:80348:19) [<root>]
at Zone.run (http://localhost:8080/dist/app.bundle.js:107191:43) [<root> => <root>]
at http://localhost:8080/dist/app.bundle.js:107826:57 [<root>]
at Zone.runTask (http://localhost:8080/dist/app.bundle.js:107231:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:8080/dist/app.bundle.js:107659:35) [<root>]
at resolvePromise (http://localhost:8080/dist/app.bundle.js:107778:31) [<root>]
at resolvePromise (http://localhost:8080/dist/app.bundle.js:107749:17) [<root>]
at http://localhost:8080/dist/app.bundle.js:107826:17 [<root>]
at Zone.runTask (http://localhost:8080/dist/app.bundle.js:107231:47) [<root> => <root>]
at drainMicroTaskQueue (http://localhost:8080/dist/app.bundle.js:107659:35) [<root>]
I could fix the issue. May seem strange but it worked like this. My app is multi-modular , I imported NgxDatatableModule in the root module and it was giving me the error. I then imported it in the child module , it worked 😃
@PeterSawyer:
did you import NgxDatatableModule to your *.spec.ts?
Here you go Austin,
I am only a newby with ng2 and cannot seem to attach a zip to this ticket of example but to recreate this issue took only a few minutes as per the below steps.
Versions
Create new project and test
Install Swimlane ngx-datatable
app.module.ts
app.component.html
app.component.ts
Run it
Test it
Dropbox link run an npm update
Hope this helps Regards
Hi,
I was getting this error and it was due to my setup. I had done everything in getting started guide but still was getting this error. The component where I was adding the code had is own module ts file and once I add the NgxDatatableModule to that module file as well it started working.
If your components have there own module files you will need to add the NgxDatatableModule import statement into that file as well.
Regards, Colin
My solution in comment: https://github.com/swimlane/ngx-datatable/issues/698#issuecomment-296739975 With Ng5. - it works!
Thanks, @kalyandas (Y)
ES->Tuve el mismo error. Solucionado importando el módulo en cada uno de los módulos hijos de la aplicación como sugería @kalyandas EN-> I had the same error. Advice of @kalyandas worked for me. Thanks.
I get passed that issue by writing
[attr.rows]="rows"instead of just[rows]though, my error isError: Template parse errors: 'ngx-datatable' is not a known element