Using JQuery Datatable with AngularJS

Datatables - AngularJS


DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool for rendering data in tables with features like,
  1. Searching record/row in table.
  2. Sorting columns.
  3. Pagination etc.
More details on Datatables:


1. AngularJS is javascript framework provided by Google.

AngularJS is very much helpful for application focused on GUI.

For large web applications, where each HTML page has full of features, Javascript has to be wrote
    systematically and well modularized otherwise as the features grows it is difficult to manage 

    AngularJS gives out of box features for writing javascript in well modularized fashion.

4. AngularJS html-javascript binding work very nicely and is of great use.
    (javascript variable used in html automically gets updated in view, when value of that variable  

    changes dynamically.)

Lot more features make AngularJS great to use.

More details on AngularJS:

Now let's see how to use JQuery Datatables in AngularJS based application.
Visit for complete angular datatables configuration.

So, Lets start the basic angular datatable configuration.

Download angular datatable directive and supporting files from

<!DOCTYPE html>
<html ng-app="angularDatatableModule">
  <title>AngularJS Datatable Example</title>
     <!-- JQUERY -->
     <script src="angular-datatables-master/vendor/jquery/dist/jquery.js"></script>     
     <script src="angular-datatables-master/vendor/datatables/media/js/jquery.dataTables.min.js"></script>
     <link rel="stylesheet" href="angular-datatables-master/vendor/datatables/media/css/jquery.dataTables.min.css">
     <!-- ANGULAR -->
     <script src="angular-datatables-master/vendor/angular/angular.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.directive.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.instances.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.util.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.renderer.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.factory.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.options.js"></script>
     <script src="angular-datatables-master/src/angular-datatables.js"></script>

     <!-- CUSTOM -->
     <script src="js/datatableController.js"></script>

    <table datatable="" class="row-border hover">
       <th>First name</th>
       <th>Last name</th>

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


Post covers very basic "Hello World" application to make you familiar with Datatables integration with AngularJS application.

You may also like to see

Number Range Spinner in Angular JS

What is Websocket? How Websocket works? Hello World WebSocket Program which updates Number of Clients connected to Server in Real time.

Download binary file AngularJS + REST service

Hello World application using Angular2 + Typescript + Webpack + Maven

Enjoy !!!! 

If you find any issue in post or face any error while implementing, Please comment.

Post a Comment