Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- angular.module('demo', [])
- .controller('Hello', function($scope, $http) {
- $http.get('http://localhost:8080/rest/cart').
- then(function(response) {
- $scope.items = response.data;
- });
- $scope.removeFromCart = function(productId) {
- $http.delete('/delete/' + productId)
- .then(function (data) {
- $http.get('/cart');
- });
- };
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement