1(function () { 2 'use strict'; 3 4 angular 5 .module('app.cart') 6 .component('cartItem', { 7 template: '<div ng-include="vm.getTemplateUrl()"></div>', 8 bindings: { 9 item: '<', 10 refreshCart: '&' 11 }, 12 controllerAs: 'vm', 13 controller: controller 14 }); 15 16 controller.$inject = ['cartDataService', 'common', 'exception']; 17 18 function controller(cartDataService, common, exception) { 19 var vm = this; 20 21 vm.removeCartItem = removeCartItem; 22 vm.getTemplateUrl = getTemplateUrl; 23 24 ///////// 25 26 function getTemplateUrl() { 27 return '/app/cart/cart-item-' + vm.item.itemType + '.html'; 28 } 29 30 function removeCartItem(id) { 31 32 if (confirm('Are you sure you want to DELETE this Item?')) { 33 34 return cartDataService.removeCartItem(id) 35 .then(function success(data) { 36 common.logger.success('Item was deleted successful from the cart', 'SUCCESS'); 37 common.$broadcast('header-cart-refresh'); 38 vm.refreshCart(); 39 }); 40 } 41 42 } 43 } 44 45 46 47 48 49}());
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.