title: catching Angular Bootstrap UI $uibModal closed event after the modal was closed
body: <p>I'm opening a modal window using $uibModal.open from another controller, and need to be notified when the modal window was closed completely (and not during closing...) so I'll be able to run a function.</p>
  
  <p>The code that opens the modal is as follows:</p>
  
  <pre><code>var modalInstance = $uibModal.open({
    templateUrl: "myModalContent.html",
    controller: "termModalCtrl",
    windowClass: 'app-modal-window',
    resolve: {
      'params': function () { return id }
    }
  });
  </code></pre>
  
  <p>I saw some suggested solutions to use:</p>
  
  <pre><code>modalInstance.result.then(function(result) {
  });
  </code></pre>
  
  <p>The problem is that the function callback is called prior to the actual closing of the modal window (when the modal window is still open) and this is not the behavior I want cause it means that it catches the "closing" event and not the "closed" event of the modal.</p>
  
  <p>Is there a neat and simple way to implement this? I'd be surprised if not since this behavior is very common in any UI frameworks on the planet... </p>
  
  <p>Please help!</p>