Getting started

Dependencies

The required dependencies are:

This module has been tested with the following datatables modules:


Download

Manually

The files can be downloaded on  GitHub.

With Bower

$ bower install angular-datatables

Installation

Include the JS file in your index.html file:

 You must include the JS file in this order. AngularJS MUST use jQuery and not its jqLite!

Declare dependencies on your module app like this:

angular.module('myModule', ['datatables']);

Additional Notes

  • RequireJS is not supported.
  • Each time a datatable is rendered, a message is sent to the parent scopes with the id of the table and the DataTable itself.
    For instance, for the given dataTable:

    You can catch the event like this in your parent directive or controller:

    $scope.$on('event:dataTableLoaded', function(event, loadedDT) { // loadedDT === {"id": "foobar", "DataTable": oTable, "dataTable": $oTable} // loadedDT.DataTable is the DataTable API instance // loadedDT.dataTable is the jQuery Object // See http://datatables.net/manual/api#Accessing-the-API });
  • Angular Datatables is using Object.create() to instanciate options and columns.

    If you need to support IE8, then you need to add this Polyfill.