title: Unknown provider: $uibModalInstanceProvider - Bootstrap UI modal
body: <p>I have a problem with UI Bootstrap modal.</p>
  
  <p>In one controller I have this:</p>
  
  <pre><code>app.controller("tableCtrl",['$scope','$http','$uibModal','$log' ,function ($scope, $http,$uibModal,$log) {
    $scope.open = function (size,selectedUser) {
    var modalInstance = $uibModal.open({
      animation: $scope.animationsEnabled,
      templateUrl: 'myModalContent.html',
      controller:'ModalInstanceCtrl',
      size: size,
      resolve: {
        user: function () {
          return selectedUser;
        }
      }
    });
  }]);
  </code></pre>
  
  <p>In another I have this:</p>
  
  <pre><code>app.controller('ModalInstanceCtrl',['$scope','$uibModalInstance','user', function ($scope, $uibModalInstance, user) {
    $scope.user = user;
    $scope.ok = function () {
      $uibModalInstance.close();
    };
  }]);
  </code></pre>
  
  <p><code>myModalContent</code> looks like this:</p>
  
  <pre><code>&lt;script type="text/ng-template" id="myModalContent.html"&gt;
      &lt;div class="modal-header"&gt;&lt;h1&gt;EDIT&lt;/h1&gt;&lt;/div&gt;
      &lt;div class="modal-body"&gt; 
          {{patient.patient_id}}
      &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;button class="btn btn-primary" type="button" ng-click="ok()"&gt;OK&lt;/button&gt;
      &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I only call <code>tableCtrl</code> in HTML and call <code>open</code> function like this:</p>
  
  <pre><code>&lt;button class="btn btn-primary" ng-click="open('lg',patient)"&gt;Edit&lt;/button&gt;
  </code></pre>
  
  <p>When I click the edit button I receive this exception:</p>
  
  <pre><code>Unknown provider: $uibModalInstanceProvider &lt;- $uibModalInstance
  </code></pre>
  
  <p>I saw <a href="http://plnkr.co/edit/khySg1gJjqz1Qv4g4cS5?p=preview" rel="noreferrer">this plunker</a> but it didnt help me.</p>
  
  <p>What is wrong?</p>