title: Is there a way to have mapping populate a property of the model asynchronously and have the view update automatically?
body: <p>I'm trying to load the values for a model's property through AJAX, but on AJAX' completion the view is not updated. </p>
  
  <p>I'm using knockout 2.0.0 and knockout mapping 2.0.3.</p>
  
  <p><strong>jsFiddle:</strong></p>
  
  <p><a href="http://jsfiddle.net/rsfTy/" rel="nofollow">http://jsfiddle.net/rsfTy/</a></p>
  
  <p><strong>HTML:</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;p&gt;Code: &lt;span data-bind="text: item.code"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;p&gt;Value: &lt;span data-bind="text: item.value"&gt;&lt;/span&gt;&lt;/p&gt;
  </code></pre>
  
  <p><strong>JavaScript:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>var ViewModel = function () {
      var self = this;
  
      self.item = ko.mapping.fromJS({ "code": "123" });
  
      self.load = function () {
          jQuery.ajax({
              "success": function () {
                  ko.mapping.fromJS({ "value": "abc" }, {}, self.item);
              },
              "url": "/echo/json"
          });            
      };
  
      self.load();
  };
  
  ko.applyBindings(new ViewModel());
  </code></pre>
  
  <p>In this example the value of <code>item.code</code> is displayed because it's defined when the viewmodel is initialized, but the value of <code>item.value</code> is never shown because is filled in asynchronously.</p>
  
  <p>I've already tried the various permutations of <code>ko.observable</code> and <code>ko.mapping.fromJS</code>, both for property initialization and update, to no avail.</p>
  
  <p>I would like to avoid - if possible - to initialize all the <code>item</code>'s properties by hand.</p>
  
  <p>I also know I can move <code>ko.applyBindings</code> inside the <code>success</code> of the AJAX call, but I have more than one property like this and to do it I'd have to implement a queue system, which is an overkill.</p>
  
  <p>What am I doing wrong? What's the correct way do it?</p>