Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

ERROR in DataTablesModule is not an NgModule #940

Closed
drullo opened this issue Jan 10, 2017 · 8 comments
Closed

ERROR in DataTablesModule is not an NgModule #940

drullo opened this issue Jan 10, 2017 · 8 comments

Comments

@drullo
Copy link

drullo commented Jan 10, 2017

When I build the app, it throws the error "ERROR in DataTablesModule is not an NgModule". The data is displayed correctly, however I cannot sort or filter my table data (the data disappears when I do). I am fetching my data via a service on ngOnInit.

  • angular version: 2.4.2
  • jquery version: 3.1.1
  • datatables version: 1.10.13
  • angular-datatables version: 2.0.1
  • typescript version: 2.0.10
@l-lin
Copy link
Owner

l-lin commented Jan 13, 2017

Are you using angular-cli?
Can you share your code when you declare your app module?

@adriangraf
Copy link

Using angular-cli, get the same error.
With [dtOptions] tag, you got following error too:
Can't bind to 'dtOptions' since it isn't a known property of 'table'.

@adriangraf
Copy link

using
angular-cli: 1.0.0-beta.24

@l-lin
Copy link
Owner

l-lin commented Jan 13, 2017

It's seems it's not an issue from angular-datatables. See this issue.

As a quick workaround, downgrade your angular-cli version to 1.0.0-beta.21.

@drullo
Copy link
Author

drullo commented Jan 13, 2017

I've actually abandoned DataTables altogether (at least for right now). While it's been a useful tool for a lot of applications, the current state of DataTables is causing me a little too much grief. I talked to the DataTables author yesterday and he stated that it won't be Angular 2 compliant until he has a chance to do some work on it in the future. The "Not an NgModule" error is the least of my problems.

So I've transitioned to the PrimeNG library, which has an AWESOME DataTable component. It is a full suite of Angular 2 components, ready-to-go and they are very professionally designed. Spend a couple of hours kicking it around and you'll probably love it too.

@adriangraf
Copy link

adriangraf commented Jan 19, 2017

Thank you for your reply, but PrimNg is not what I am looking for.
We use Bootstrap and PrimeNg with Bootstrap seems not to be good.
So I use the DataTable Plugin via JQuery and now I can use all the plugins and extensions.

@drullo
Copy link
Author

drullo commented Jan 19, 2017

adriangraf, I've been using PrimeNG with Bootstrap in several projects and have had no conflicts at all. Can you elaborate on the problems that you've experienced? In my experience, PrimeNG has not been a problem with Bootstrap.

Believe me... I want DataTables to work be a viable solution for my Angular projects. But unfortunately it's just not quite there right now. PrimeNG, on the other hand, is built specifically for Angular and you don't have to do any tricks to get it to work. And no jQuery needed - so it's a much more organic Angular approach.

@adriangraf
Copy link

How do you have styled the PrimeNg grid?
We use a bootstrap template for the application.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants