title: Bundling controllers in a module gives undefined in angularjs 1.5
body: <p>I want to bundle all of my controllers in same module say app.core but it results in undefined.</p>
  
  <p>app.js</p>
  
  <pre><code>angular.module('app',['ui.router','app.routes','app.core']);
  </code></pre>
  
  <p>app.core.js</p>
  
  <pre><code>angular.module('app.core', []);
  </code></pre>
  
  <p>sidebar.ctrl.js</p>
  
  <pre><code> angular.module('app.core',['ui.router','ui.bootstrap'])
  .controller('SidebarController',function($scope,$uibModal){
   $scope.login=function(){
      $uibModal.open({
          templateUrl:'./partials/login/login.modal.tpl.html',
          size:'sm',
          controller:'LoginController'
      });
  }});
  </code></pre>
  
  <p>login.ctrl.js</p>
  
  <pre><code>angular.module('app.core',['ui.router','ui.bootstrap'])
  .controller('LoginController',function($scope){
  $scope.closeLoginModal=function(){
      $uibModalInstance.dismiss('cancel');
  }});
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;script type="text/javascript" src="app.core.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="partials/sidebars/sidebar.ctrl.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="partials/login/login.ctrl.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>When I run with above sequence of loading js files it gives Argument 'SidebarController' is not a function got undefined but when I comment login.ctrl.js script it gives no error but when opening login modal results in 'LoginController' is not a function got undefined.</p>
  
  <p>Any help would be appreciated.</p>