(function (angular) {
    'use strict';


    // Mix in to our module
    var module;
    try {
        module = angular.module('coUtils');
    } catch (e) {
        module = angular.module('coUtils', []);
    }


    // Globals
    var modals = {},    // The various pop-ups
        container = document.createElement('div');

    // This is where our popup elements will reside
    container = angular.element(container);
    container.attr('id', 'modals');
    angular.element(document.body).append(container);


    module
        .controller('Modals', ['$scope', function($scope) {
            $scope.showModal = function (name) {
                modals[name].show();
            };

            $scope.closeModal = function (name) {
                modals[name].close();
            };
        }])

        .directive('modal', ['$timeout', '$animate', function($timeout, $animate) {
            return {
                scope: {
                    name: '@',
                    title: '@',
                    animation: '=?'
                },
                restrict: 'E',
                transclude: true,
                template:
                    '<div>' +
                        '<div>' +
                            '<div class="modal-header"><h1>{{title}}</h1>' +
                                '<span class="close" ng-click="close"></span>' +
                            '</div>' +
                            '<div class="modal-content" ng-transclude></div>' +
                        '</div>' +
                    '</div>',
                controller: function() {},
                link: function(scope, element, attrs, ctrl) {
                    var name = scope.name;

                    // Detach the element from the DOM
                    element.detach();

                    // Add the controller to the popup registry
                    modals[name] = ctrl;
                    scope.animation = scope.animation || 'co-modal';

                    // Provide the controller show and close functions
                    ctrl.show = function () {
                        container.append(element);
                        return $animate.addClass(element, scope.animation);
                    };

                    ctrl.close = function () {
                        return $animate.removeClass(element, scope.animation).then(function () {
                            element.detach();
                        });
                    };

                    // On destroy, unregister the popup
                    scope.$on('$destroy', function () {
                        ctrl.close()['finally'](function () {
                            element = null;
                        });
                        ctrl.close = angular.noop;
                        ctrl.show = angular.noop;
                        delete modals[name];
                    });
                }
            };
        }]);

}(this.angular));

@@ -1316,16 +1316,34 @@
   '%3Cspan
+ ng-if=%22showClose%22
  class=%22
@@ -1373,24 +1373,24 @@
 %3E%3C/span%3E' +%0A
-
             
@@ -1709,17 +1709,16 @@
 e.name;%0A
-%0A
         
@@ -1733,78 +1733,82 @@
     
-// Detach the element from the DOM%0A                    element.detach(
+    %0A                    scope.showClose = !attrs.hasOwnProperty('noClose'
 );%0A%0A
@@ -2484,32 +2484,501 @@
             %7D;%0A%0A
+                    // Detach the element from the DOM%0A                    if (scope.showClose) %7B%0A                        element.on('touch click', function () %7B%0A                            scope.$apply(ctrl.close);%0A                        %7D);%0A                        element.children().children().on('touch click', function (e) %7B%0A                            e.stopPropagation();%0A                        %7D);%0A                    %7D%0A                    element.detach();%0A%0A
                 
@@ -3065,32 +3065,32 @@
 , function () %7B%0A
-
                 
@@ -3127,32 +3127,78 @@
 %5D(function () %7B%0A
+                            element.remove();%0A
                 

Improve closing options