title: Can't Find Controller from HTML
body: <p>I'm working with a Play framwork project using angular-seed project as a basis. It creates an array of controllers and passes them into the angularjs instance I guess, somewhat different to other tutorials I've seen. When I try to link a div to the controller the controller function isn't found:</p>
  
  <pre><code>angular.js:13920 Error: [ng:areq] Argument 'menuCtrl' is not a function, got undefined
  </code></pre>
  
  <p>Here's how I link in the controller:</p>
  
  <pre><code>&lt;div id="wrapper" class="row row-offcanvas row-offcanvas-left" ng-controller="menuCtrl" uib-collapse="showMenu" horizontal&gt;
  
        &lt;div id="sidebar-wrapper" class="col-xs-6 col-sm-3 sidebar-offcanvas" ng-show="menuOpen" role="navigation"&gt;
  
          &lt;ul class="nav nav-pills nav-stacked"&gt;
              &lt;li&gt;&lt;a href="#/view1"&gt;view1&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#/view2"&gt;view2&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  
        &lt;/div&gt;
  
        &lt;div id="page-content-wrapper" class="col-xs-12 col-sm-9"&gt;
  
          &lt;div ng-view&gt;&lt;/div&gt;
  
          &lt;div&gt;Angular seed app: v&lt;span app-version&gt;&lt;/span&gt;&lt;/div&gt;
  
        &lt;/div&gt;
  
    &lt;/div&gt;
  </code></pre>
  
  <p>Here's the main.js:</p>
  
  <pre><code>/*global require, requirejs */
  
  'use strict';
  
  requirejs.config({
    paths: {
      'angular': ['../lib/angularjs/angular'],
      'angular-route': ['../lib/angularjs/angular-route'],
      'ui-bootstrap':['../lib/angular-ui-bootstrap/ui-bootstrap']
    },
    shim: {
      'angular': {
        exports : 'angular'
      },
      'angular-route': {
        deps: ['angular'],
        exports : 'angular'
      },
        'ui-bootstrap': {
            deps: ['angular'],
            exports: 'ui-bootstrap'
        }
    }
  });
  
  require(['angular', './controllers', './directives', './filters', './services', 'angular-route', "ui-bootstrap"],
    function(angular, controllers) {
  
      // Declare app level module which depends on filters, and services
  
      angular.module('eprogram2', ['eprogram2.filters', 'eprogram2.services', 'eprogram2.directives', 'ngRoute']).
        config(['$routeProvider', function($routeProvider) {
          $routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: controllers.MyCtrl1});
          $routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: controllers.MyCtrl2});
          $routeProvider.otherwise({redirectTo: '/view1'});
        }]);
  
      angular.module('eprogram2', ['ui.bootstrap']);
  
      angular.bootstrap(document, ['eprogram2']);
  
  
    });
  </code></pre>
  
  <p>and the controller.js:</p>
  
  <pre><code>'use strict';
  
  define(function() {
  
      /* Controllers */
  
      var controllers = {};
  
      controllers.MyCtrl1 = function() {}
      controllers.MyCtrl1.$inject = [];
  
      controllers.MyCtrl2 = function() {}
      controllers.MyCtrl2.$inject = [];
  
      controllers.menuCtrl = function($scope, $window) {
          $scope.menuOpen = false;
  
          console.log("MenuCtrl");
  
          // Detect if mobile portrait screen size
          $scope.is_mobile = ($window.innerWidth &lt;= 480);
  
          if ($scope.isMobile) {
              $scope.menuOpen = false;
              console.log("mobile detected - close menu")
          } else {
              $scope.menuOpen = true;
              console.log("not mobile - open menu")
          }
  
      }
      controllers.menuCtrl.$inject = ['$scope', '$window'];
  
      return controllers;
  
  });
  </code></pre>
  
  <p>I've tried using the template project's controllers and mine but no go. The routing instructions find their controllers no problem in main.js, but the controllers don't seem to be exposed to the HTML page. I've tried:</p>
  
  <p>eprogram2.controllers.menuCtrl
  controllers.menuCtrl
  eprogram2.menuCtrl</p>
  
  <p>formats as well, but all return the same not a function, got undefined message. Any suggestions about what my boneheaded mistake is? </p>