(function () {
  angular
    .module('app')
    .factory('$semodal', function ($compile) {
      function show(scope, content) {
        $('se-modal').remove();
        var modal = $('<se-modal />');
        modal.html(content);

        $('ui-view').append(modal);
        $compile(modal)(scope);
      }

      function hide() {
        $('se-modal .close').click();
        $('se-modal .modal').on('hidden.bs.modal', function () {
          $('se-modal').remove();
        });
      }

      return {
        show: show,
        hide: hide
      };
    })
    .component('seModal', {
      templateUrl: 'app/utils/modal.html',
      transclude: true,
      controller: function () {
        var modal = $('se-modal > div');
        modal.modal();
      }
    });
})();

@@ -366,119 +366,8 @@
 ();%0A
-        $('se-modal .modal').on('hidden.bs.modal', function () %7B%0A          $('se-modal').remove();%0A        %7D);%0A
     
@@ -628,24 +628,120 @@
 al.modal();%0A
+        modal.on('hidden.bs.modal', function () %7B%0A          $('se-modal').remove();%0A        %7D);%0A
       %7D%0A    

Ao fechar uma modal. Elimina o se-modal