title: Position of bootstrap modal window in AngularJS
body: <p>My modal window from boostrap with AngularJS always opens at the bottom of the window, not as an overlay.</p>
  
  <p>Mark Up:</p>
  
  <pre><code>&lt;div class ="ngView-Container" ng-view ng-controller="galleryController" &gt;
  
      &lt;div ng-controller="galleryController"&gt;
          &lt;script type ="text/ng-template" id="overlay.html"&gt;
  
              &lt;div class="modal-header"&gt;
                  &lt;h3 class="modal-title"&gt;Modal &lt;/h3&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                      &lt;div id="overlay"&gt;
                          &lt;img ng-src={{photo}}&gt;          
                      &lt;/div&gt;
  
              &lt;button class="btn btn-default" ng-click="ok()"&gt;
                  CLOSE
              &lt;/button&gt;
      &lt;/div&gt;
  
  
          &lt;/script&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>I am using bootstrap UI for modal dialog    </p>
  
  <pre><code>var myAppController = angular.module('myAppController',['ui.bootstrap']);
  </code></pre>
  
  <p>In my controller:</p>
  
  <pre><code>  $scope.open = function(arg){
  
              var modelInstance = $modal.open({
                  templateUrl: "overlay.html",
                  scope: $scope,
                  controller: "ModalInstanceCtrl",
                  resolve : {
                          photo : function(){
                              return arg;
                          }
                  },
  
  
              });
  
  
   myAppController.controller("ModalInstanceCtrl",function($scope, $modalInstance, photo){
              $scope.photo = photo;
              $scope.ok = function(){
                  $modalInstance.close();
              }
          })
  </code></pre>
  
  <p>Additional question:
  If I apply <code>position=fixed, top=0, left=0 to &lt;div class="overlay&gt;</code> which is inside <code>&lt;div class= "modal-body"&gt;</code>, the overlay appears with top margin for some reason. </p>