title: Knockout.js mapping a JSON into an observable-array
body: <p>I want to build a client for my REST-Service using Knockout.js. 
  I have a lot of Repositorys i want to access through different urls - so i came up with this solution using the Revealing-Prototype-Pattern.
  My <strong>problem</strong>: I can not find out how to map the ItemsProperty with my "data" i receive from my service.</p>
  
  <pre><code>var Repository = function (url) {
      this.Url = url;
      this.Items = ko.observableArray([]);
      this.PendingItems = ko.observableArray([]);
  };
  
  Repository.prototype = function () {
      var  
          getAllItems = function () {
              var self = this;
              $.getJSON(self.Url, function (data) {
              // data=[{"Id":1,"Name":"Thomas","LastName":"Deutsch"},{"Id":2,"Name":"Julia","LastName":"Baumeistör"}]
                  ko.mapping.fromJS(data, self.Items);
              });
          }, 
      ...
  
  
  // i call it like this:
  customerRepository = new Repository('http://localhost:9200/Customer');
  customerRepository.getAllItems();
  </code></pre>
  
  <p>I think the problem is in this: <strong><em>ko.mapping.fromJS(data, self.Items);</em></strong> but i can not find the right way to do it.<br>
  <strong>Question</strong>: what am i doing wrong? i have found an example - and they are doing the same i think:  <a href="http://jsfiddle.net/jearles/CGh9b/">http://jsfiddle.net/jearles/CGh9b/</a></p>