2

I'm trying to get angularjs working with jquery datatables, i'm using the samples found here: https://l-lin.github.io/angular-datatables/#/angularWay

I've included the required scripts, but when I update my module to include datatables I get an error:

var testModule = angular.module("testModule", ['ngResource', 'ngRoute', 'ngSanitize', 'datatables']);

I get the following error:

Uncaught Error: [$injector:modulerr] This error occurs when a module fails to load due to some exception. The error message above should provide additional context. A common reason why the module fails to load is that you've forgotten to include the file with the defined module or that the file couldn't be loaded.

removing the 'datatables' from there and it works but without datatables. I've included the below scripts in the following order:

jquery.min.js
jquery.dataTables.min.js
angular.min.js
angular-datatables.js
test-module.js

In the examples I don't see anything to indicate where the datatables would come from it not from the angular-datatables.js file.

1 Answer 1

2

it looks like "datatables" module may not have been registered. How are you loading you JS files ?

Sign up to request clarification or add additional context in comments.

4 Comments

i'm my original post, i have the list of js files i've included, angular-datables.js is there, and i can see if loaded fine as i can view its' contents on the site. When I look at that file I see it has dependecies on other files, i will try to include those as well. angular.module('datatables', ['datatables.directive', 'datatables.factory']) .run(initAngularDataTables);
Have you checked version of angular in you app, and version of angular datatables is expecting ?
I added in the other .js files that datables was using and it looks now.
@Paritosh Please add your last comment as answer and mark as resolved. Your comment is actually the solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.