title: Angular get event on modal creation
body: <p>Simple question,</p>
  
  <p>I'm using Angular UI to show modals.</p>
  
  <p>I have an application that opens multiple modals,</p>
  
  <p>the modals has issue with the screen height and i added a code that optimize the modal size to the height of the screen.</p>
  
  <p>The thing is i want to be notified when there is a new modal created so i can call my function for fixing the modal size.</p>
  
  <p>Any ideas how i get notified for modal creation?</p>
  
  <p>Thanks,</p>
  
  <p>Examples of modal cration:</p>
  
  <pre><code>// create the modal instance and show the popup
  var modalInstance = $modal.open({
      templateUrl: 'partials\mymodal.html',
      windowClass: "modal fade in app-modal-window",
      controller: controllertest,
      resolve:{
          resultData:function(){ return null;}
      },
      backdrop: 'static',
  
      dialogFade: true,
      keyboard: false,
      fade:true,
      size:'lg'
  });
  
  // destroy the modal instance on cancel
  var unbind_modal_popup = $scope.$on('$destroy', function ()
  {
      if (modalInstance != undefined)
      {
          modalInstance.dismiss('cancel');
      }
  });
  
  // return handler.
  modalInstance.result.then(function (data) {
  
  
      // set the country field
      unbind_modal_popup();
  }, function () {
      unbind_modal_popup();
  })
  };
  </code></pre>
  
  <p>Example of Modal HTML:</p>
  
  <pre><code>&lt;div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope in small-modal" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" ng-click="close($event)" modal-window="" window-class="modal fade in small-modal" size="sm" index="0" animate="animate"&gt;
      &lt;div class="modal-dialog modal-sm" ng-class="{'modal-sm': size == 'sm', 'modal-lg': size == 'lg'}"&gt;&lt;div class="modal-content" modal-transclude=""&gt;&lt;div id="parameter-modal" class="ng-scope"&gt;
          &lt;p&gt;Text inside modal&lt;/p&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>