raw/angular-datatables/angular-datatables.js
function (options) {
        var oTable;
        var _render = function (options, $elem, $scope) {
          // Set it to true in order to be able to redraw the dataTable
          options.bDestroy = true;
          // Add $timeout to be sure that angular has finished rendering before calling datatables
          $timeout(function () {
            _hideLoading($elem);
            // Condition to refresh the dataTable
            if (oTable) {
              if (_hasReloadAjaxPlugin(oTable)) {
                // Reload Ajax data using the plugin "fnReloadAjax": https://next.datatables.net/plug-ins/api/fnReloadAjax
                // For DataTable v1.9.4
                oTable.fnReloadAjax(options.sAjaxSource);
              } else if (!_isDTOldVersion(oTable)) {
                // For DataTable v1.10+, DT provides methods https://datatables.net/reference/api/ajax.url()
                var ajaxUrl = options.sAjaxSource || options.ajax.url || options.ajax;
                oTable.ajax.url(ajaxUrl).load();
              } else {
                throw new Error('Reload Ajax not supported. Please use the plugin "fnReloadAjax" (https://next.datatables.net/plug-ins/api/fnReloadAjax) or use a more recent version of DataTables (v1.10+)');
              }
            } else {
              oTable = _renderDataTableAndEmitEvent($elem, options, $scope);
            }
          }, 0, false);
        };
        return {
          options: options,
          render: function ($scope, $elem) {
            var _this = this;
            // Define default values in case it is an ajax datatables
            if (angular.isUndefined(_this.options.sAjaxDataProp)) {
              _this.options.sAjaxDataProp = DT_DEFAULT_OPTIONS.sAjaxDataProp;
            }
            if (angular.isUndefined(_this.options.aoColumns)) {
              _this.options.aoColumns = DT_DEFAULT_OPTIONS.aoColumns;
            }
            $scope.$watch('dtOptions.sAjaxSource', function (sAjaxSource) {
              if (angular.isDefined(sAjaxSource)) {
                _this.options.sAjaxSource = sAjaxSource;
                if (angular.isDefined(_this.options.ajax)) {
                  if (angular.isObject(_this.options.ajax)) {
                    _this.options.ajax.url = sAjaxSource;
                  } else {
                    _this.options.ajax = { url: sAjaxSource };
                  }
                }
              }
              _render(options, $elem, $scope);
            });
            $scope.$watch('dtOptions.reload', function (reload) {
              if (reload) {
                $scope.dtOptions.reload = false;
                _render(options, $elem, $scope);
              }
            });
          }
        };
      }
function (options) {
        var oTable;
        var _render = function (options, $elem, $scope) {
          // Set it to true in order to be able to redraw the dataTable
          options.bDestroy = true;
          // Add $timeout to be sure that angular has finished rendering before calling datatables
          $timeout(function () {
            _hideLoading($elem);
            // Condition to refresh the dataTable
            if (oTable) {
              if (_hasReloadAjaxPlugin(oTable)) {
                // Reload Ajax data using the plugin "fnReloadAjax": https://next.datatables.net/plug-ins/api/fnReloadAjax
                // For DataTable v1.9.4
                oTable.fnReloadAjax(options.sAjaxSource);
              } else if (!_isDTOldVersion(oTable)) {
                // For DataTable v1.10+, DT provides methods https://datatables.net/reference/api/ajax.url()
                var ajaxUrl = options.sAjaxSource || options.ajax.url || options.ajax;
                oTable.ajax.url(ajaxUrl).load();
              } else {
                throw new Error('Reload Ajax not supported. Please use the plugin "fnReloadAjax" (https://next.datatables.net/plug-ins/api/fnReloadAjax) or use a more recent version of DataTables (v1.10+)');
              }
            } else {
              oTable = _renderDataTableAndEmitEvent($elem, options, $scope);
            }
          }, 0, false);
        };
        return {
          options: options,
          render: function ($scope, $elem) {
            var _this = this;
            // Define default values in case it is an ajax datatables
            if (angular.isUndefined(_this.options.sAjaxDataProp)) {
              _this.options.sAjaxDataProp = DT_DEFAULT_OPTIONS.sAjaxDataProp;
            }
            if (angular.isUndefined(_this.options.aoColumns)) {
              _this.options.aoColumns = DT_DEFAULT_OPTIONS.aoColumns;
            }
            $scope.$watch('dtOptions.sAjaxSource', function (sAjaxSource) {
              if (angular.isDefined(sAjaxSource)) {
                _this.options.sAjaxSource = sAjaxSource;
                if (angular.isDefined(_this.options.ajax)) {
                  if (angular.isObject(_this.options.ajax)) {
                    _this.options.ajax.url = sAjaxSource;
                  } else {
                    _this.options.ajax = { url: sAjaxSource };
                  }
                }
              }
              _render(options, $elem, $scope);
            });
            $scope.$watch('dtOptions.reload', function (reload) {
              if (reload) {
                $scope.dtOptions.reload = false;
                _render(options, $elem, $scope);
              }
            });
          }
        };
      }
function ( options ) { var oTable ; var _render = function ( options , $elem , $scope ) { // Set it to true in order to be able to redraw the dataTable options . bDestroy = true ; // Add $timeout to be sure that angular has finished rendering before calling datatables $timeout ( function ( ) { _hideLoading ( $elem ) ; // Condition to refresh the dataTable if ( oTable ) { if ( _hasReloadAjaxPlugin ( oTable ) ) { // Reload Ajax data using the plugin "fnReloadAjax": https://next.datatables.net/plug-ins/api/fnReloadAjax // For DataTable v1.9.4 oTable . fnReloadAjax ( options . sAjaxSource ) ; } else if ( ! _isDTOldVersion ( oTable ) ) { // For DataTable v1.10+, DT provides methods https://datatables.net/reference/api/ajax.url() var ajaxUrl = options . sAjaxSource || options . ajax . url || options . ajax ; oTable . ajax . url ( ajaxUrl ) . load ( ) ; } else { throw new Error ( 'Reload Ajax not supported. Please use the plugin "fnReloadAjax" (https://next.datatables.net/plug-ins/api/fnReloadAjax) or use a more recent version of DataTables (v1.10+)' ) ; } } else { oTable = _renderDataTableAndEmitEvent ( $elem , options , $scope ) ; } } , 0 , false ) ; } ; return { options : options , render : function ( $scope , $elem ) { var _this = this ; // Define default values in case it is an ajax datatables if ( angular . isUndefined ( _this . options . sAjaxDataProp ) ) { _this . options . sAjaxDataProp = DT_DEFAULT_OPTIONS . sAjaxDataProp ; } if ( angular . isUndefined ( _this . options . aoColumns ) ) { _this . options . aoColumns = DT_DEFAULT_OPTIONS . aoColumns ; } $scope . $watch ( 'dtOptions.sAjaxSource' , function ( sAjaxSource ) { if ( angular . isDefined ( sAjaxSource ) ) { _this . options . sAjaxSource = sAjaxSource ; if ( angular . isDefined ( _this . options . ajax ) ) { if ( angular . isObject ( _this . options . ajax ) ) { _this . options . ajax . url = sAjaxSource ; } else { _this . options . ajax = { url : sAjaxSource } ; } } } _render ( options , $elem , $scope ) ; } ) ; $scope . $watch ( 'dtOptions.reload' , function ( reload ) { if ( reload ) { $scope . dtOptions . reload = false ; _render ( options , $elem , $scope ) ; } } ) ; } } ; }
Renderer for displaying with Ajax
@param options the options
@returns {{options: *}} the renderer
@constructor
Renderer for displaying with Ajax