question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting it working with webpack

See original GitHub issue

I am trying to get DataTables working with webpack using angular 2.4.

What versions you are using?

  • angular version: 2.4
  • jquery version: 3.1.1
  • datatables version: 1.10.13
  • angular-datatables version: 2.1.0
  • angular-MM version: ?

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.

npm install jquery --save
npm install datatables.net --save
npm install datatables.net-dt --save
npm install angular-datatables --save

In app.module.ts I added at the top:

import { DataTablesModule } from 'angular-datatables';

and at the ‘imports’ key under @NgModule:

    DataTablesModule,

Then in table.template.html I added the HTML from the “Zero configuration” Getting Started manual.

<table datatable class="row-border hover">
...
</table>

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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:25 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jiwlee0625commented, Sep 3, 2018

Look at this: https://github.com/l-lin/angular-datatables/issues/1295

Summary: just run npm install angular-datatables@6.0.0

3reactions
burakkiliccommented, Oct 9, 2017

I’m getting the same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started - webpack
Webpack is used to compile JavaScript modules. Once installed, you can interact with webpack either from its CLI or API.
Read more >
Getting Started With Webpack - Smashing Magazine
Let's take a deep dive into what webpack is and how to use it in your ... When running it the build command...
Read more >
A mostly complete guide to webpack 5 (2020)
Getting started with webpack. First steps with webpack. Configuring webpack. Working with HTML. webpack's development server.
Read more >
Webpack Tutorial for Beginners: A Complete Step ... - CodeinWP
Read this webpack tutorial for beginners to learn your first steps in bundling and serving HTML/JavaScript in an optimal fashion.
Read more >
A Beginner's Guide to Webpack - SitePoint
In this tutorial, I'll introduce all the core concepts to help you get started. Note: in this tutorial I've used webpack 5.9.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found