title: Durandal List with Composition (ASP .NET MVC)
body: <p>I am trying to use Durandal to generate a list of data. Because this data will be updated by a dialog I need the list item to represent a view model.  For this, view composition seems appropriate, but I must be missing something with how to do this.  Note: I am using ASP .NET MVC so my pathing is a bit different. However, at this point, I am not seeing any web requests for my view nor are the debugger; lines in my View Model being hit.</p>
  
  <p>Here is the code:
  The HTML:</p>
  
  <pre><code>&lt;tbody data-bind="foreach: workItems"&gt;
      &lt;!-- ko compose: {model: 'viewmodels/project/workItem', view: 'views/project/workitem'} --&gt;
      &lt;!-- /ko --&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Here is the JS for the view model intended to represent each line in the list:</p>
  
  <pre><code>define(['knockout'], function(ko) {
      var vm = function () {
          var that = this;
          this.activate = function(ctx) {
              debugger;
          };
      };
  
      return vm;
  });
  </code></pre>
  
  <p>Here is the code which handles the GET request returning the data:</p>
  
  <pre><code>this.activate = function (ctx) {
      var q = null;
  
      if (ctx == undefined) {
          q = that._getCurrent();
      } else {
          q = that._getPath(ctx);
      }
  
      q.then(function (response) {
          that.workItems(response);
          app.trigger('viewmodel:loadingComplete');
      });
  };
  </code></pre>
  
  <p>I have tried using system.acquire so as to add VMs to my observable array, this failed to show any results. My thinking was that I need composition so I get the binding to fire for each line. (this may be wrong).  I am really looking for an example of this working. Quite perplexed that I have not been able to find anything on SO or Google.</p>
  
  <p>Thanks in advance</p>