title: Failed to load modules
body: <p>Hello i am trying to develop a web app with angular. I have added the ng-app="appApp" to the html file and also the .js files.</p>
  
  <p>main.controller.js</p>
  
  <pre><code>(function () {
  'use strict';
  
  // register the controller as MainController
  angular
      .module('appApp.main')
      .controller('MainController', MainController);
  
  /**
   * @ngdoc function
   * @name appApp.main.provider:MainController
   * @description
   * Provider of the {@link appApp.main.controller:MainController MainController}
   *
   * @param {Service} $scope The scope service to use
   * @param {Service} $http The http service to use
   */
  
  // MainController.$inject = [];
  
  function MainController() {
      var vm = this;
  }
  
  })();
  </code></pre>
  
  <p>main.js</p>
  
  <pre><code>(function () {
  'use strict';
  
  // register the route config on the application
  angular
      .module('appApp.main', ['ui.router'])
      .config(configMainRoute)
  
  // inject configMainRoute dependencies
  configMainRoute.$inject = ['$stateProvider', 'mainMenuProvider'];
  
  // route config function configuring the passed $stateProvider
  function configMainRoute($stateProvider, mainMenuProvider) {
      var mainState = {
          name: 'main',
          url: '/',
          authenticate: true,
          templateUrl: 'app/main/main.html',
          controller: 'MainController',
          controllerAs: 'vm'
      };
  
      $stateProvider.state(mainState);
  
      mainMenuProvider.addMenuItem({
          name: 'Home',
          state: mainState.name,
          order: 1
      });
  }
  
  })();
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>(function () {
  'use strict';
  
  angular
      .module('appApp', [
          // Add modules below
          'ngCookies',
          'ngResource',
          'ngSanitize',
          'ngMessages',
          'ngMaterial',
          'ui.router',
          'btford.socket-io',
          'appApp.main'
      ])
      .config(appConfig)
      .run(appRun);
  </code></pre>
  
  <p>...........</p>
  
  <p>When i run the app i get this errors:</p>
  
  <ol>
  <li>Error: [ng:areq] Argument 'MainController' is not a function, got undefined </li>
  <li>Uncaught Error: [$injector:nomod] Module 'appApp.main' 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.</li>
  </ol>
  
  <p>How can i fix that errors? Thank you</p>