title: Center Angular modal ui
body: <p>I am playing with angular modal ui dialog. I wonder what is the way to center it ? I find a similar question:
  <a href="https://stackoverflow.com/questions/18691071/twitter-bootstrap-center-modal-dialog">Twitter Bootstrap - Center Modal Dialog</a></p>
  
  <p>but was unable to make it work as I am rather new to angular. Here is a simplified version of the plunker for modal dialog from the angular ui components page:</p>
  
  <p><a href="http://plnkr.co/edit/M35rpChHYThHLk17g9zU?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/M35rpChHYThHLk17g9zU?p=preview</a></p>
  
  <pre><code>&lt;script type="text/ng-template" id="myModalContent.html"&gt;
          &lt;div class="modal-header"&gt;
              &lt;h3&gt;I'm a modal!&lt;/h3&gt;
          &lt;/div&gt;
          &lt;div class="modal-body"&gt;
              test
          &lt;/div&gt;
          &lt;div class="modal-footer"&gt;
              &lt;button class="btn btn-primary" ng-click="ok()"&gt;OK&lt;/button&gt;
              &lt;button class="btn btn-warning" ng-click="cancel()"&gt;Cancel&lt;/button&gt;
          &lt;/div&gt;
      &lt;/script&gt;
  
      &lt;button class="btn btn-default" ng-click="open()"&gt;Open me!&lt;/button&gt;
  </code></pre>
  
  <p>js:</p>
  
  <pre><code>angular.module('plunker', ['ui.bootstrap']);
  var ModalDemoCtrl = function ($scope, $modal) {
  
    $scope.open = function () {
  
      var modalInstance = $modal.open({
        templateUrl: 'myModalContent.html',
        controller: ModalInstanceCtrl
      });
  
    };
  };
  
  
  var ModalInstanceCtrl = function ($scope, $modalInstance) {
  
    $scope.ok = function () {
      $modalInstance.close("ok");
    };
  
    $scope.cancel = function () {
      $modalInstance.dismiss("cancel");
    };
  };
  </code></pre>
  
  <p>My idea is to take the dimensions of the page dynamically when the modal is open and resize and center it, but I am not sure how can I do that as I am rather new to angularjs. Any help with working example will be greatly appreciated.</p>