title: The controller with the name 'mainController' is not registered
body: <p>i have this code in my script.js file</p>
  
  <pre><code>var mainController = function($scope){
    $scope.message = "Plunker";
  };
  </code></pre>
  
  <p>and this is my HTML</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html ng-app&gt;
      &lt;head&gt;
          &lt;script data-require="angular.js@1.6.1" data-semver="1.6.1"    src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="style.css" /&gt;
          &lt;script src="script.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body ng-controller="mainController"&gt;
          &lt;h1&gt;Hello {{ message }}&lt;/h1&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i declared ng-app in the opening html tag</p>
  
  <p>but i get this error on my console that mainController is not registered</p>