title: Angular - Error: $injector:modulerr Module Error
body: <p>I know this problem has been asked many time but I cannot find an answer.</p>
  
  <p>I found a nice starting tutorial of just using controllers and services to run an api call and load some data onto the page.</p>
  
  <p>I know however am looking to use routing to load different api data onto different pages.</p>
  
  <p>Because of this, I know have:</p>
  
  <pre><code>//app.js
  
  var app = angular.module('app', ['ngRoute', 'mainCtrl', 'randomCtrl', 'imageService']);
  
  app.config(function($routeProvider) {
      $routeProvider
      .when('/', {
          templateUrl : 'pages/home.html',
          controller  : 'mainController'
      });
  });
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>//mainCtrl.js
  
  angular.module('mainCtrl', [])
  
  .controller('mainController', function($scope, $http, Image) {
      // loading variable to show the spinning loading icon
      $scope.loading = true;
  
      Image.get()
          .success(function(data) {
              $scope.images = data;
              $scope.loading = false;
              console.log(data);
          });
  
  });
  </code></pre>
  
  <p>In the head of my file I have route linked:</p>
  
  <pre><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js"&gt;&lt;/script&gt; &lt;!-- load angular --&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.0-beta.1/angular-route.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>My full error is this: </p>
  
  <pre><code>Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.8/$injector/modulerr?p0=app&amp;p1=Error%3A%20%…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.8%2Fangular.min.js%3A29%3A115)
  </code></pre>
  
  <p>Everything worked fine when I was just using the controller to run the API call and then ng repeat the results. Using Laravel 5 if its any interest.</p>