title: angular-datatables in a directive. Cant call function in withFnServerData()
body: <p>i have a question about calling a function in a Angular directive. Below is my directive, where i want to encapsulate the code from the controller. From the controller i get the URL and the columns. dtOptions is set in the directive. </p>
  
  <p>That works so far and the table appears. The problem is that the DTOptionsBuilder doesn´t call the function serverData. when i add the brackets in FnServerData(serverData()), the method is called, but the parameters are undefined. The code works when defined in the controller. </p>
  
  <p>Do you see a way that works? </p>
  
  <p><strong>Directive</strong></p>
  
  <pre><code> angular.module('tab')
    .directive('tabledirective', tableDirective); 
  
    function tableDirective(DTOptionsBuilder, DTColumnBuilder, RESTService){
  
  
      return {
        templateUrl: '../../views/tableTemplate.html',
        restrict: 'E',
        link: function (scope, elem, attr) {   
              var dtOption;
  
              function serverData(sSource, aoData, fnCallback) {
                  //All the parameters you need is in the aoData variable
                  var draw = aoData[0].value;
                  var order = aoData[2].value;
                  var start = aoData[3].value;
                  var length = aoData[4].value;
                  var search = aoData[5].value;
                  //Then just call your service to get the records from server side
                  RESTService.get(scope.options.url, start, length, search, order, draw).success(function (result) {
                    var records = {
                        'draw': result.data.draw,
                        'recordsTotal': result.data.total,
                        'recordsFiltered': result.data.filtered,
                        'data': result.data.records
                    };
                    fnCallback(records);
                 });
              };
  
            dtOption = DTOptionsBuilder
                .newOptions()
                .withFnServerData(serverData)
                .withBootstrap()
                .withDataProp('data')
                .withOption('processing', true)
                .withOption('serverSide', true)
                .withOption('paging', true)
                .withPaginationType('full_numbers')
                .withDisplayLength(10);  
  
            scope.options.dtoptions = dtOption;     
        }
      };
    }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>angular.module('tab')
   .controller('tableCtrl', tableCtrl);
  
  function tableCtrl(DTColumnBuilder, DTOptionsBuilder, $scope){
  
    $scope.options = {
        dtcolumns: [
          DTColumnBuilder.newColumn('Age', 'Alter'),
          DTColumnBuilder.newColumn('Adresse', 'Adresse'),
          DTColumnBuilder.newColumn('Name', 'Name')
        ],
        dtoptions: '',
        url: 'http://localhost:9000/api/Data/Get'
    };
  }
  </code></pre>