title: How to pass the DTOptionsBuilder and DTColumnBuilder to the controller in angular-datatables
body: <p>I started to learn <code>AngularJS-1.5.7</code> and also <code>angular-datatables</code>. I followed some examples in this page <a href="https://l-lin.github.io/angular-datatables/#/withResponsive" rel="nofollow">https://l-lin.github.io/angular-datatables/#/withResponsive</a> the one that is for responsive tables, and the one that is for using bootstrap styling. I adapted the examples to make them work in my application, but now I have the following problem:</p>
  
  <p>If I declare my controller in this way:</p>
  
  <pre><code>angular.module('MyApp', ['datatables', 'datatables.bootstrap'])
      .controller('BootstrapIntegrationCtrl', BootstrapIntegrationCtrl);
  
  function BootstrapIntegrationCtrl(DTOptionsBuilder, DTColumnBuilder) {
  var vm = this;
  vm.dtOptions = DTOptionsBuilder.fromSource('http://localhost:8080/Myapp/user/getUser')
          .withPaginationType('full_numbers')
          // Add Bootstrap compatibility
          .withBootstrap()
          // Active Responsive plugin
          .withOption('responsive', true);
  vm.dtColumns = [
      DTColumnBuilder.newColumn('idUser').withTitle('ID'),
      DTColumnBuilder.newColumn('name').withTitle('Name'),
      DTColumnBuilder.newColumn('lastName').withTitle('Last Name'),
      // .notVisible() does not work in this case. Use .withClass('none') instead
  //    
  
  DTColumnBuilder.newColumn('roleList').withTitle('Role List').withClass('none')
      DTColumnBuilder.newColumn('roleList').withTitle('Role List')
  ];
  }
  </code></pre>
  
  <p>The other controllers in my application stop working, but the example works fine, the page that has the BootstrapIntegrationCtrl works fine and the tables shows up without any issues, but the other controllers stop working.</p>
  
  <p>My other controllers are defined like this: </p>
  
  <pre><code>angular.module('MyApp')
      .controller('RoleCtrl', ['$scope', 'RoleService', 'modalService',
          function ($scope, RoleService, modalService) {
  }]);
  </code></pre>
  
  <p>but If I try to pass the <code>DTOptionsBuilder or DTColumnBuilder</code> to my controller in the following way I get the undefined error</p>
  
  <p>this cause undefined in the line where I use any of this variables </p>
  
  <pre><code>DTOptionsBuilder, DTColumnBuilder 
  </code></pre>
  
  <p>this cause undefined error </p>
  
  <pre><code>angular.module('MyApp')
      .controller('RoleCtrl', ['$scope', 'RoleService', 'modalService',
          function ($scope, RoleService, modalService, DTOptionsBuilder, DTColumnBuilder) {
  var vm = this;
  vm.dtOptions = DTOptionsBuilder.fromSource('http://localhost:8080/Myapp/user/getUser')
          .withPaginationType('full_numbers')
          // Add Bootstrap compatibility
          .withBootstrap()
          // Active Responsive plugin
          .withOption('responsive', true);
  vm.dtColumns = [
      DTColumnBuilder.newColumn('idUser').withTitle('ID'),
      DTColumnBuilder.newColumn('name').withTitle('Name'),
      DTColumnBuilder.newColumn('lastName').withTitle('Last Name'),
      // .notVisible() does not work in this case. Use .withClass('none') instead
  //    
  
  DTColumnBuilder.newColumn('roleList').withTitle('Role List').withClass('none')
      DTColumnBuilder.newColumn('roleList').withTitle('Role List')
  ];
  
  
  }]);
  </code></pre>
  
  <p>I need those variables in my controller but I don't know how to pass them.
   I also tried using the <code>$scope</code> variable like this <code>$scope.DTColumnBuilder</code> but I get the same undefined error.</p>