ngRoute preventing view from seeing controller
<p>I'm currently working on an application and the view can't find the controller for some reasons. I suspect it's because of the ngRoute in the app.js. This is the error I'm getting: Argument 'MainCtrl' is not a function.<br>
Below is a snippet of the code.</p>

<p>HTML</p>

<pre><code>&lt;div ng-controller="MainCtrl"&gt;  
&lt;script src="select.controller.js"&gt;&lt;/script&gt;
&lt;div&gt;
&lt;label&gt;Pick a title:
&lt;select ng-model="data. title"&gt;
&lt;option value="Mr"&gt;Mr&lt;/option&gt;
&lt;option value="Mrs"&gt;Mrs&lt;/option&gt;
&lt;/select&gt;
&lt;/label&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label&gt;Type your name:
&lt;input type="text" ng-model="data.test"&gt;
&lt;/label&gt;
&lt;/div&gt;
&lt;input type="submit" ng-click="info()"&gt;
&lt;/div&gt;
</code></pre>

<p>JS 
    var app = angular.module('app', []);</p>

<pre><code>app.controller('MainCtrl', function($scope) {

$scope.data = {
title: "Mr",
test: ""
}

$scope.info = function()
{
alert("you are " + $scope.data.title + " " + $scope.data.test)
console.log('T');

}

});
</code></pre>

<p>App.js</p>

<pre><code>(function () {
'use strict';
angular
.module('app', ['ngRoute', 'ngCookies'])
.config(config)
.run(run);
config.$inject = ['$routeProvider', '$locationProvider'];
function config($routeProvider, $locationProvider) {
$routeProvider
.when('/', {
controller: 'HomeController',
templateUrl: 'home.view.html',
controllerAs: 'vm',
})

.when('/select', {
controller: 'SelectController',
templateUrl: 'select.html',
controllerAs: 'vm',

.when('/login', {
controller: 'LoginController',
templateUrl: 'login.view.html',
controllerAs: 'vm'
})

.when('/register', {
controller: 'RegisterController',
templateUrl: 'register.view.html',
controllerAs: 'vm'
});
}
run.$inject = ['$rootScope', '$location', '$cookieStore', '$http'];
function run($rootScope, $location, $cookieStore, $http) {
// keep user logged in after page refresh
$rootScope.globals = $cookieStore.get('globals') || {};
if ($rootScope.globals.currentUser) {
$http.defaults.headers.common['Authorization'] = 'Basic ' +        $rootScope.globals.currentUser.authdata; // jshint ignore:line
}
$rootScope.$on('$locationChangeStart', function (event, next,  current) {

var restrictedPage = $.inArray($location.path(), ['/login', '/register']) === -1;
var loggedIn = $rootScope.globals.currentUser;
if (restrictedPage &amp;&amp; !loggedIn) {
$location.path('/login');
           }
 });
 }
</code></pre>

<p>})();</p>