title: Failed to instantiate module demoApp due to: Error: [$injector:nomod] Module 'demoApp' is not available
body: <p>I am trying to build a simple SPA using angular and ngRoute/ngView. I simply cannot make it work.</p>
  
  <p>I get the error: angular.js:68
  Uncaught Error: [$injector:modulerr] Failed to instantiate module demoApp due to:
  Error: [$injector:nomod] Module 'demoApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.</p>
  
  <p>I have looked at various code examples on the web as well as youtube tutorials and compared my code to theirs, but I simply cannot figure out what I am doing wrong. To me, they look identical.</p>
  
  <p>I apologize in advance, this seems to be a question that has been asked a lot in the past, but previous answers have not been to any help for me.</p>
  
  <p>This is my HTML-file, it is called "test.html".
     </p>
  
  <pre><code>&lt;html ng-app="demoApp"&gt;
    &lt;head&gt;
          &lt;title&gt;My Angular App&lt;/title&gt;
  
    &lt;/head&gt;
  
    &lt;body&gt;
        &lt;h2&gt;DemoApp Demo&lt;/h2&gt;
          &lt;div&gt;
              &lt;a href="#/partial1.html"&gt;Partial 1&lt;/a&gt;
              &lt;a href="#/partial2.html"&gt;Partial 2&lt;/a&gt;
              &lt;div ng-view&gt;&lt;/div&gt;     
          &lt;/div&gt;
          &lt;script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.js"&gt;&lt;/script&gt;
          &lt;script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular-route.js"&gt;&lt;/script&gt;
          &lt;script src = "demoApp.js" /&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is "demoApp.js", it is in the same directory as test.html</p>
  
  <pre><code>var demoApp = angular.module('demoApp', ['ngRoute']);
  
  demoApp.config(['$routeProvider', function($routeProvider) {
      $routeProvider
  
          .when('/partial1',
          {
              controller: 'SimpleController',
              templateUrl: 'Partials/partial1.html'
          }).when('/partial2',
          {
              controller: 'SimpleController',
              templateUrl: 'Partials/partial2.html'
          }).otherwise({redirectTo: '/partial1'});
  }]);
  
  
  demoApp.controller('SimpleController', function($scope){
      $scope.customers = [
          {name:'Victor', city:'Norrköping'}, 
          {name:'Mikael', city:'Göteborg'}, 
          {name:'Jocke',  city:'Göteborg'}, 
          {name:'Skåne',  city:'Ystad'}
      ];
  
      $scope.addCustomer = function(){
          $scope.customers.push(
          {
              name: $scope.newCustomer.name, 
              city: $scope.newCustomer.city
          });
      }
  });
  </code></pre>
  
  <p>I did not include Partial1 and Partial2 as they seem irrelevant to the problem as they are only simple HTML files with no scripts.</p>