(function(angular) { "use strict"; var app = angular.module('Swagwise'); // Inject in the CartService app.controller('CartController', function($scope) { // Set the items on the scope to the items in the CartService using the getItems method $scope.items = {}; $scope.addItem = function(item) { // Pass the item into the addItem method of the CartService }; $scope.getItemCount = function() { // Return the item count from the CartService }; $scope.getCartSubtotal = function() { // Return the subtotal using the getCartSubtotal method of the CartService }; $scope.getCartTotal = function() { // Return the cart total using the getCartTotal methode of the CartService }; $scope.removeItem = function(id) { // Pass the item id into the removeItem method of the CartService }; $scope.emptyCart = function() { // Invoke the emptyCart method of the CartService } $scope.checkout = function() { // Invoke the checkout method of the CartService }; }); })(window.angular);