title: knockout js nested models with inherited data
body: <p>I'm making knockout js models. Ideally I would like to have subviews for each page. The model would look something like this:</p>
  
  <pre><code>function viewModel()
  {
      var self = this;
      self.people = ko.observableArray([{"name":"Alice", parent:"Bill"},{"name":"Bill":"parent":"Candy"},{"name":"Candy","parent":""}]);
  
      function kidsModel()
      {
           var self = this;
           self.kids = ko.utils.arrayFilter(people, function(person) {
                return person.parent != "";
            }); 
      }
  
      function parentsModel()
      {
           var self = this;
           self.parents = ko.utils.arrayFilter(
                              ko.utils.arrayMap(people, function(person){
                                  return person.parent;
                             })
                          , function(person) {
                                return person.parent != "";
                          });
      }
  }
  </code></pre>
  
  <p>The key components are that I can segment the code with subviews and share data that is filtered through the root view. I have found plenty of info on setting things up in knockout with nice subviews but not about filtering data between them in a way that leverages knockout.</p>