title: Bootstrap-angular-ui modal on load
body: <p>I am using <a href="http://angular-ui.github.io/bootstrap/#/modal" rel="noreferrer">bootstrap-angular-ui-modal</a> for a site I am working on. The code I am using to open the modal </p>
  
  <pre><code>$modal.open(
      {
          templateUrl: '/home/template',
          controller: myCtrl,
          resolve: {
              data: function () {
                  return data;
              }
          }
      });
  </code></pre>
  
  <p>Everything is working fine. But I need to find a way to execute some code after modal is loaded. I tried different things but can't make them work. Some of things I tried</p>
  
  <p>In template I did </p>
  
  <pre><code>&lt;script&gt;
      document.onload = function () {
          console.log('opened');
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>I also found there is a promise for the angular modal object named openned. I tried to </p>
  
  <pre><code>modalInstance.opened.then(function(){console.log('hello')});
  </code></pre>
  
  <p>not working either. I can use some help here.</p>