title: Uncaught Error: Module 'myApp' is not available! (AngularJS)
body: <p>I'm working on angular tutorial and i'm having a problem on beginning. Loading myApp module throws error. As explained in tutorial, this should be one of three ways to create controller.<br><br>
  Here is print screen from tutorial i'm working on:
   <a href="https://i.stack.imgur.com/c1PUr.png" rel="noreferrer"><img src="https://i.stack.imgur.com/c1PUr.png" alt="Creating controllers in tutorials"></a></p>
  
  <p>When i refresh web page i get this error in Chrome console:</p>
  
  <pre><code>Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
  Error: [$injector:nomod] Module 'myApp' 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.
  </code></pre>
  
  <p>This is my HTML file</p>
  
  <pre><code>  &lt;html ng-app="myApp"&gt;
          &lt;head&gt;
          &lt;/head&gt;
          &lt;body&gt;
              &lt;h1&gt;Hello world!&lt;/h1&gt;   
  
              &lt;div ng-controller="MainController"&gt;
                  {{ 2+2 }}
                  &lt;br&gt;
                  {{ val }}
              &lt;/div&gt;
              &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js"&gt;&lt;/script&gt;
              &lt;script src="app.js"&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>This is my app.js file</p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  
  var MainController = function($scope){
      $scope.val = "Main controller variable value"
  }
  </code></pre>
  
  <p>So what is my problem? I can't figure it out.</p>
  
  <p>Thank you in advance</p>