I had success declaring my module / factory this way. I think that basically what happens is that you enter the factory in your DT module ( myDataTables ), which you "extended" from datatables and datatables.bootstrap .
In addition, I found out that for my purposes there are two half-sized concepts of loading / processing. The boot template and the processing text ... if you use server-side processing, they both come into play. I include use for both here for posterity.
var dtLoadingTemplate; dtLoadingTemplate = function() { return { html: '<img src="images/loading.gif">' }; }; angular.module('myDataTables', ['datatables', 'datatables.bootstrap']).run(function(DTDefaultOptions) { DTDefaultOptions.setLanguage({
Then your controller might look something like this:
myApp.controller('UsersController', [ '$scope', 'DTOptionsBuilder', 'DTColumnBuilder', function($scope, DTOptionsBuilder, DTColumnBuilder) { $scope.dtInstance = null; $scope.dtOptions = DTOptionsBuilder.newOptions().withOption('ajax', { dataSrc: 'data', url: '/users.json', type: 'POST' }) .withOption('processing', true) .withOption('serverSide', true) .withPaginationType('full_numbers').withBootstrap() .withOption('aaSorting', [0, 'desc']) .withOption('createdRow', function(row, data, dataIndex) { $scope.users.push(data); return $compile(angular.element(row).contents())($scope); }); return $scope.dtColumns = [ DTColumnBuilder.newColumn('id').withTitle('ID').withClass('user-id'), DTColumnBuilder.newColumn('name').withTitle('Title').withClass('user-name'), DTColumnBuilder.newColumn(null).withTitle('Actions').withClass('users_actions').notSortable().renderWith(function(user, type, full, meta) { return "<a class='btn btn-link' href='/users/" + user.id + "'>" + "<span class='fa fa-external-link fa-lg text-default' tooltip-placement='bottom' tooltip='View User'></span></a>"; }) ]; } ]);
http://l-lin.imtqy.com/angular-datatables/#/overrideLoadingTpl