title: Error: "angular was used before it was defined" but online editors able to output the result
body: <p>I couldn't get an output from this code when I ran it my local machine but the weird part is online editors able to give me an output: <a href="http://codepen.io/anon/pen/waXGom" rel="nofollow">http://codepen.io/anon/pen/waXGom</a></p>
  
  <p>*Im using Adobe Brackets editor</p>
  
  <p>Here is my HTML code:</p>
  
  <pre><code>    &lt;!DOCTYPE html &gt;
    &lt;html&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"&gt;&lt;/script&gt;
      &lt;script src= "app.js"&gt;&lt;/script&gt;    
      &lt;body ng-app="MyApp"&gt;
  
  &lt;div ng-controller="Controller2"&gt;
      &lt;button ng-click="add()"&gt;Add Object&lt;/button&gt;
      &lt;button ng-click="reset()"&gt;Reset&lt;/button&gt;
      &lt;div remove="remove($index)" ng-repeat="name in names"&gt;
          {{name}}
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my JS code:</p>
  
  <pre><code>var myApp = angular.module('myApp', []);
  
      myApp.controller('Controller2', function ($scope) {
          $scope.names = [];
      var data = ['Dean', 'Andy', 'Dan', 'Wizek', 'Pete', 'Pawel', 'Chris', 'Misko'];
      $scope.add = function() {
          if (data.length)
              $scope.names.push(data.pop());
      };
  
          $scope.reset = function(index) {
          data.push($scope.names.splice(index, 1)[0]);
      };
      });
  </code></pre>
  
  <p>Please help me to figure it out...</p>