title: AngularJS app not running correctly
body: <p>I'm new to AngularJS.  I'm trying to run a simple example from a book, but it's not working correctly, and I can't figure out why.</p>
  
  <p>This code runs fine:</p>
  
  <pre><code>&lt;html ng-app&gt;
  &lt;head&gt;
      &lt;script src="angular.js"&gt;&lt;/script&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Angular &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div ng-controller="HelloController"&gt;
          &lt;input ng-model="greeting.text"/&gt;
          &lt;p&gt;{{greeting.text}}, World!&lt;/p&gt;
      &lt;/div&gt;
      &lt;script src="angular.js"&gt;&lt;/script&gt;
      &lt;script&gt;
               function HelloController($scope) {
                   $scope.greeting = {text: 'Hello'};
               }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/GiOA2.jpg" alt="enter image description here"></p>
  
  <p>But this is the code I'm having problems with</p>
  
  <pre><code>&lt;html ng-app='myApp'&gt;
  &lt;head&gt;
      &lt;title&gt;Shopping Cart&lt;/title&gt;
      &lt;script src="angular.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body ng-controller='CartController'&gt;
      &lt;h1&gt;Your Order&lt;/h1&gt;
      &lt;div ng-repeat="item in items"&gt;
          &lt;span&gt;{{item.title}}&lt;/span&gt;
          &lt;input ng-model="item.quantity"&gt;
          &lt;span&gt;{{item.price| currency}}&lt;/span&gt;
          &lt;span&gt;{{item.price * item.quantity| currency}}&lt;/span&gt;
          &lt;button ng-click="remove($index)"&gt;Remove&lt;/button&gt;
      &lt;/div&gt;
      &lt;script src="angular.js"&gt;&lt;/script&gt;
      &lt;script&gt;
                  function CartController($scope) {
                      $scope.items = [
                          {title: 'Paint pots', quantity: 8, price: 3.95},
                          {title: 'Polka dots', quantity: 17, price: 12.95},
                          {title: 'Pebbles', quantity: 5, price: 6.95}
                      ];
                      $scope.remove = function(index) {
                          $scope.items.splice(index, 1);
                      };
                  }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Expecting this output: </p>
  
  <p><img src="https://i.stack.imgur.com/f7OnF.jpg" alt="enter image description here"></p>
  
  <p>But getting this output:</p>
  
  <p><img src="https://i.stack.imgur.com/0xZqM.jpg" alt="enter image description here"></p>
  
  <p>I don't understand why I'm not getting the data output, and why it's not repeating.  Basically, why the example is not running.  I copy and paste the code straight from the book.</p>