-
Notifications
You must be signed in to change notification settings - Fork 490
Getting it working with webpack #978
Comments
I got the CSS loaded at least, by adding this to table.component.ts:
But I got this error:
Apparently this is related to the loader used in webpack. I solved this by installing
And changing the following in webpack.common.js:
to
Now my datatable is styled, but still lacking interactivity. |
When trying the AJAX-example I get the error:
edit: I found out that in the dist folder of version 2.1.0 the @input() and selector:'[datatable]' lines are missing in angular-datatables.directive.ts. But they are present in the src folder of this repository. When I replace them, it works! |
Mmmh weird... Looking at the dist file, Can you show me the file that fixed your issue? |
This line is missing in dist: https://github.com/l-lin/angular-datatables/blob/v2.1.0/src/angular-datatables.directive.ts#L20 . And also Line 14. |
It's defined here: https://github.com/l-lin/angular-datatables/blob/v2.1.0/dist/angular-datatables.directive.js#L37 |
What I did for now is add the line
to my custom Module. This works, so I guess Angular is importing the .js files instead of the .ts files. Previously I was directly importing the .ts files from /dist/ and that's where I got the errors. |
same here, with ng2-admin.
|
With version 2.3.0 the above problem has gone away. So now I can just add
I followed the steps from the docs, but now I get the following error:
Searching for it on the internet tells me it might be about loading jQuery twice, but I can't find where I would be doing this in webpack. I'm not experienced with that. Anyone has a clue? |
I am using angular-datatables together with ng2-datepicker. datatables requires jQuery to be added in the script tag section and datepicker requires jQuery to be added to the systemjs map. jQuery is loaded twice and thats why the error |
No, I did not get this working. I keep getting the |
I'm getting the same error. |
Same |
Any solution to above ERROR TypeError: $(...).DataTable is not a function even i am getting the same error |
I'm getting the same error. |
I was getting the same error. After a long winter, I find out that I was missing the import of the scripts in the angular-cli.json file: "styles": [ |
m getting an error |
getting same problem as deneshgautam...any solutions? |
Look at this: #1295 Summary: just run npm install [email protected] |
thanks jiwlee0625 |
app.module.ts:64 Uncaught ReferenceError: DataTablesModule is not defined |
I'm getting the same error. |
getting error: ERROR ReferenceError: $ is not defined |
Try to install these packages:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to inactivity. Please feel free to re-open the issue to add new inputs. |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to get DataTables working with webpack using angular 2.4.
What versions you are using?
What's the problem?
I can't get my table interactive. I don't know where to put the dependencies.
Can you share your code?
This is what I have so far. I added this to install dependencies in package.json.
In app.module.ts I added at the top:
and at the 'imports' key under @NgModule:
Then in table.template.html I added the HTML from the "Zero configuration" Getting Started manual.
But now I don't know how to make the table a datatable. Should I add an import somewhere? I am not using Angular-CLI so the manual does not help me here.
The text was updated successfully, but these errors were encountered: