<html ng-app>
<head>
  <title>Twój koszyk na zakupy</title>
</head>
<body ng-controller='CartController'>
<h1>Twój koszyk na zakupy</h1>
<div ng-repeat='item in items'>
  <span>{{item.title}}</span>
  <input ng-model='item.quantity'>
  <span>{{item.price | currency}}</span>
  <span>{{item.price * item.quantity | currency}}</span>
  <button ng-click="remove($index)">Usuń</button>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.20/angular.min.js"></script>
<script>
  function CartController($scope) {
    $scope.items = [
      {title: 'Farby', quantity: 8, price: 3.95},
      {title: 'Sukienka w kropki', quantity: 17, price: 12.95},
      {title: 'Kryształ górski', quantity: 5, price: 6.95}
    ];

    $scope.remove = function(index) {
      $scope.items.splice(index, 1);
    };
  }
</script>
</body>
</html>
