title: Durandal 2.0 custom dialog
body: <p>I wish to make a Durandal custom dialog that adds a window frame with title and footer around an existing composable viewmodel.</p>
  
  <p>I have made a customModal.html template</p>
  
  <pre><code>&lt;div class="messageBox"&gt;
      &lt;div class="modal-header"&gt;
          &lt;h3 data-bind="text: title"&gt;&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          &lt;!--ko compose: { model: model, template: view }--&gt;
          &lt;!--/ko--&gt;
      &lt;/div&gt;
      &lt;div class="modal-footer" data-bind="foreach: options"&gt;
          &lt;button class="btn" data-bind="click: function () { $parent.selectOption($data); }, text: $data, css: { 'btn-primary': $index() == 0, autofocus: $index() == 0 }"&gt;&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>As you can see I wish to compose a viewmodel within the body of the customModal template. This is so that the viewmodel passed in is not tied to a modal display but can easily use one.</p>
  
  <p>I have made a customModal.js model like this:</p>
  
  <pre><code>define(['plugins/dialog'], function (dialog) {
      var CustomModal = function (title, model, view, options) {
          this.title = title;
          this.model = model;
          this.view = view;
          this.options = options;
      };
  
      CustomModal.prototype.selectOption = function (dialogResult) {
          dialog.close(this, dialogResult);
      };
  
      return CustomModal;
  });
  </code></pre>
  
  <p>But when I try and use it the compose binding searches for the template '.html' and fails.</p>
  
  <p>Am I missing something here? And is this really the best way to do this?</p>
  
  <p>Thanks.</p>