(function(){'use strict';varapp=angular.module('bootstrapper',['ngRoute']);// do other config things with the app like routing, etc.)();
Then onto my controllers:
123456789
(function(app){'use strict';app.controller('registrationController',['$scope',function($scope){// registration stuff}]);})(angular.module('bootstrapper',[]));// this is bad
123456789
(function(app){'use strict';app.controller('signinController',['$scope',function($scope){// sign in stuff}]);})(angular.module('bootstrapper',[]));// this is bad
When I run this, the registrationController is never found. Moving it to be declared after the signinController leads to the signinController never being found. Huh?
The secret is in the array on the angular.module() call. Adding the array tells angular that you want a new angular module which dumps the initial one that you just created for the first controller.
The correct way to create the controllers using this form of controller set up is: