(function(angular) { "use strict"; var app = angular.module('Swagwise'); // Inject in the CartService app.directive('miniCart', function() { return { // Create an isolated scope scope: { }, restrict: 'E', replace: true, templateUrl: 'templates/mini-cart.html', link: function(scope, elem, attr) { scope.getCartSubtotal = function() { // Returns subtotal from CartService }; scope.getItemCount = function() { //Returns the item count from the CartService }; } }; }); })(window.angular);