title: angular ui modal after close event
body: <p>Is there a way I can call a function after a modal window got called (no matter if it happened with a button or by clicking on the backdrop)</p>
  
  <pre><code>var dialog, options;
  
  options = {
    windowClass: "lightBox"
    templateUrl: "url to the template",
    controller: "some random controller",
    scope: $scope
  });
  
  $("body").css({
    'overflow': 'hidden'
  });
  
  dialog = $modal.open(options);
  
  dialog.result.then(function() {
    $("body").css({
      'overflow': 'auto'
    });
  });
  </code></pre>
  
  <p>I want that everytime the modal windows closes the function in the result.then promise get executed. Now it just executes when i close the modal manually my $modalInstance.close(). But if i click on the backdrop this method doesn't get called</p>
  
  <p>any idea how i can do this?</p>