title: Angular UI Modal, inline template and controller
body: <p>I want to create a really simple confirmation box using UI-modal, which I have successfully used to make complicated modals that load their template and controller from external files in the past.</p>
  
  <p>It's so simple though that I don't want to rely on external template and controller files, just a simple box with a close button which is somehow wired up to a controller declared directly on the modal instance.</p>
  
  <p>Here is what I have tried unsuccessfully...</p>
  
  <pre><code>var modalInstance = $modal.open({
      template: "&lt;div&gt;Message goes here...&lt;button ng-click='cancel()'&gt;Continue&lt;/button&gt;&lt;/div&gt;",
      controller: function(){
  
          $scope.cancel = function(){
              alert("Cancelled");
          };
  
      }
  });
  </code></pre>