title: angularjs weird error loading controllers
body: <p>I've being developing angularjs for the last months and I have an app with some controllers, directives and services. Until now all have gone all right, but with the last controller I'm getting a weird error that it's making me go mad. Because the app its a bigger enough to put here all code I will put the important parts. </p>
  
  <p>In my index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app="my_app"&gt;
  &lt;head&gt;
      &lt;meta charset="encoding"&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
  
      &lt;meta name="viewport"  content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link rel="stylesheet" href="lib/ionic/css/ionic.css"&gt;
      &lt;link rel="stylesheet" href="css/style.css"&gt;
  
      &lt;!-- ionic/angularjs js --&gt;
      &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt;
      &lt;script src="lib/angular-translate/angular-translate.min.js"&gt;&lt;/script&gt;
      &lt;script src="lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- cordova script (this will be a 404 during development) --&gt;
      &lt;!--&lt;script src=""--&gt;
      &lt;script src="cordova.js"&gt;&lt;/script&gt;
  
  
      &lt;!-- your app's js --&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
      &lt;!--SERVICES--&gt;
      &lt;script src="js/services/services.js"&gt;&lt;/script&gt;
      &lt;script src="js/services/s_configDB.js"&gt;&lt;/script&gt;
      &lt;script src="js/services/s_clinicDB.js"&gt;&lt;/script&gt;
      &lt;!-- CONTROLLERS --&gt;
      &lt;script src="js/controllers/controllers.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers/c_splash.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers/c_communications.js"&gt;&lt;/script&gt;
      &lt;!--&lt;script src="js/controllers/c_communicationsB.js"&gt;&lt;/script&gt; 
      &lt;script src="js/controllers/c_clock.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers/c_menu.js"&gt;&lt;/script&gt;
      &lt;script src="js/controllers/c_language.js"&gt;&lt;/script&gt;
      &lt;!--DIRECTIVES--&gt;
      &lt;script src="js/directives/directives.js"&gt;&lt;/script&gt;
      &lt;script src="js/directives/d_menu.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body ng-controller="AppComms"&gt;
      &lt;ion-nav-view &gt;&lt;/ion-nav-view&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  At my app.js:
  
  var SDv4 = angular.module('my_app', [
      'ionic',
      'my_app.services',
      'my_app.controllers',
      'my_app.directives'
  ]);
  </code></pre>
  
  <p>At controllers.js</p>
  
  <pre><code>var app = angular.module('my_app.controllers',[
      //'ionic',
      'my_app.c_splash',
      'my_app.c_clock',
      'my_app.c_language',
      'my_app.c_comms',
      //'my_app.c_commsb',
      'pascalprecht.translate',
      'my_app.c_menu'
  ]);
  </code></pre>
  
  <p>And for example the c_communications.js</p>
  
  <pre><code>var comms = angular.module('my_app.c_comms',[])
  
  comms.controller('AppComms',['$scope',function($scope){
  
      …
  
  }])
  </code></pre>
  
  <p>This code is working ok, but if I add another controller (c_communicationsB.js) :</p>
  
  <pre><code>var commsb = angular.module('my_app.c_commsb',[])
  </code></pre>
  
  <p>and add the my_app.commsb to the controllers.js</p>
  
  <p>It gives me the error:</p>
  
  <pre><code>ionic.bundle.js:8895 Uncaught Error: [$injector:modulerr] Failed to instantiate module MY_APP due to:
  Error: [$injector:modulerr] Failed to instantiate module my_app.controllers due to:
  Error: [$injector:modulerr] Failed to instantiate module my_app.c_commsb due to:
  Error: [$injector:nomod] Module ‘my_app.c_commsb' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
  http://errors.angularjs.org/1.4.3/$injector/nomod?p0=MY_APP.c_commsb
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:8895:12
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:10785:17
      at ensure (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:10709:38)
      at module (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:10783:14)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13189:22
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13190:40
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
  http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=MY_APP.c_commsb&amp;…3A63342%2FSD4v040t2%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A13173%3A5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:8895:12
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13212:15
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13190:40
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13190:40
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
  http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=MY_APP.controlle…3A63342%2FSD4v040t2%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A13173%3A5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:8895:12
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13212:15
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
      at http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13190:40
      at forEach (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:9163:20)
      at loadModules (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13173:5)
      at createInjector (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:13099:11)
      at doBootstrap (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:10457:20)
      at bootstrap (http://localhost:63342/SD4v040t2/www/lib/ionic/js/ionic.bundle.js:10478:12)
  http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=MY_APP&amp;p1=Error%…A63342%2FSD4v040t2%2Fwww%2Flib%2Fionic%2Fjs%2Fionic.bundle.js%3A10478%3A12)
  </code></pre>
  
  <p>What is happening here?!</p>