Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     angular.module('demo', [])
  3.         .controller('Hello', function($scope, $http) {
  4.             $http.get('http://localhost:8080/rest/cart').
  5.             then(function(response) {
  6.                 $scope.items = response.data;
  7.             });
  8.             $scope.removeFromCart = function(productId) {
  9.                 $http.delete('/delete/' + productId)
  10.                     .then(function (data) {
  11.                         $http.get('/cart');
  12.                     });
  13.             };
  14.         });
  15.  
  16. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement