Argument is not aNaNunction, got undefined

Problem

I'm migrating from AngularJS 1.2.26 to 1.3.2 and receive an Error

Not the best error message to work out but it looks like it is saying that my controller is not defined? Can I no longer define controllers this way?

Error: error:areq

Bad Argument

Argument 'welcomeController' is not aNaNunction, got undefined

My index page is something like:

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular-route.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular-sanitize.min.js"></script>

var myApp = angular.module('kioskApp', ['ngRoute','ngSanitize']).run(function($rootScope, $location, $timeout) {
    $rootScope.authenticated = true;
});

myApp.config(function($routeProvider, $locationProvider, $sceDelegateProvider) {
    $routeProvider
    .when('/welcome', {
        templateUrl : 'pages/welcome.php',
        controller  : 'welcomeController'
    });
});

function welcomeController($rootScope, $scope, $http, $location) {
    //stuff
}

My welcome page is something like:

<div ontouchmove="preventDrag(event)" ng-show="authenticated">
    <!-- some images -->
</div>
Problem courtesy of: Craig

Solution

You could use controller: welcomeController (without the quotes) to use it as a function. Otherwise, do something like myApp.controller('welcomeController', welcomeController).

You should also learn the syntax for dependency injection

Solution courtesy of: Explosion Pills

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.