title: Issue - AngularJS Uncaught Error: [$injector:modulerr]
body: <p>Am completely new to AngularJS. So am trying the flow of sample application before I start the development of a new app in my project. Below is what I have tried.</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html ng-app="app"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Insert title here&lt;/title&gt;
  &lt;script src="lib/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="lib/angular-route.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src = "js/app.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h1&gt;Student Registration!&lt;/h1&gt;
      &lt;div ng-view&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>registerStudent.html</strong></p>
  
  <pre><code>&lt;table&gt;
  &lt;tr&gt;
      &lt;td&gt;&lt;input type="button" value="Save" ng-click="save()"&gt;&lt;/td&gt;
      &lt;td&gt;{{message}}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var app = angular.module("app", ['ngRoute', 'app.services', 'app.controllers']);
  
  /**routing*/
  app.config(['$routeProvider', function($routeProvider){
  
  $routeProvider.when('/editStudent', {
      templateUrl:'html/editStudent.html',
      controller:'studentReg'
  });
  
  $routeProvider.when('/viewStudent', {
      templateUrl:'html/viewStudent.html',
      controller:'studentReg'
  });
  
  $routeProvider.when('/registerStudent', {
      templateUrl:'html/registerStudent.html',
      controller:'studentReg'
  });
  
  $routeProvider.otherwise({
      redirectTo: '/registerStudent'
  });
  }]);
  </code></pre>
  
  <p><strong>services.js</strong></p>
  
  <pre><code>var app = angular.module('app.services', []);
  app.service('restService', function(){
      this.save=function(){
      return 'saved';
      };
  });
  </code></pre>
  
  <p><strong>controller.js</strong></p>
  
  <pre><code>var app = angular.module('app.controllers', []);
  app.controller('studentReg', function($scope, restService){
  $scope.result=restService.save();
      $scope.save=function(){
          console.log($scope.result);
          $scope.message=$scope.result;
      };
  });
  </code></pre>
  
  <p>When I tried to run the application, I got the below error.</p>
  
  <pre><code>Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.5.0-rc.1/$injector/modulerr?p0=app&amp;p1=Error%3…2Flocalhost%3A8080%2FEnhancedStudentform%2Flib%2Fangular.min.js%3A20%3A421)
  </code></pre>