title: Angular controller function not running, Error: [ng:areq]
body: <p>I have created basic example without external script file but while
  I am creating demo, I am using controller in <code>script.js</code> file, it is not working.</p>
  
  <p>Html Code :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"&gt;&lt;/script&gt;
    &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body ng-app&gt;
    &lt;div ng-controller="simpleController"&gt;
      &lt;strong&gt;First name:&lt;/strong&gt; {{firstName}}&lt;br /&gt;
      &lt;strong&gt;Last name:&lt;/strong&gt; &lt;span ng-bind="lastName"&gt;&lt;/span&gt;&lt;br /&gt;
      &lt;strong&gt;Full name:&lt;/strong&gt; {{getFullName()}}&lt;br /&gt;       
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>script.js</p>
  
  <pre><code>var simpleController = function ($scope)
  {
    // Initialize the model variables
    $scope.firstName = "John";
    $scope.lastName = "Doe";
  
    // Define utility functions
    $scope.getFullName = function ()
    {
      return $scope.firstName + " " + $scope.lastName;
    };
  };
  </code></pre>
  
  <p>Error in console :</p>
  
  <pre><code>Error: [ng:areq] http://errors.angularjs.org/1.5.7/ng/areq?p0=simpleController&amp;p1=not%20a%20function%2C%20got%20undefined
  O/&lt;@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:6:412
  sb@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:22:508
  Qa@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:23:78
  gf/this.$get&lt;/&lt;@https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js:89:273
  
  
  https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js
  Line 117
  </code></pre>