title: MEAN stack angular controller not defined
body: <p>I'm having a lot of trouble finding out why my controller isn't defined in my MEAN stack.  Every other controller is working just fine. </p>
  
  <pre><code>Error: Argument 'ReportsController' is not a function, got undefined
  at assertArg (http://localhost:3000/lib/angular/angular.js:1039:11)
  at assertArgFn (http://localhost:3000/lib/angular/angular.js:1049:3).....
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>window.app = angular.module('mean', ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles', 'mean.reports', 'angularFileUpload']);
  
  angular.module('mean.system', []);
  angular.module('mean.articles', []);
  angular.module('mean.songs', []);
  angular.module('mean.reports', []);
  </code></pre>
  
  <p>reports.js</p>
  
  <pre><code>angular.module('mean.reports').
  controller('ReportsController',
      ['$scope', '$routeParams', '$location', 'Global', 'Reports',
          function ($scope, $routeParams, $location, Global, Reports) {
              $scope.global = Global;
              $scope.find = function() {
                      Reports.query(function(reports) {
                          $scope.reports = reports;
                      }
                  );
              };
          }
      ]
  );
  </code></pre>
  
  <p>routes.js</p>
  
  <pre><code>    //report routes
  var reports = require('../app/controllers/reports');
  app.get('/reports', reports.all);
  app.post('/reports', auth.requiresLogin, reports.create);
  app.get('/reports/:reportId', reports.show);
  app.put('/reports/:reportId', auth.requiresLogin, auth.report.hasAuthorization, reports.update);
  app.del('/reports/:reportId', auth.requiresLogin, auth.report.hasAuthorization, reports.destroy);
  
  
  //Finish with setting up the reportId param
  app.param('reportId', reports.report);
  </code></pre>
  
  <p>EDIT: Fixed - see comment</p>