title: Knockout using Mapping and Validation Plugins together. Getting client errors
body: <p>I'm using knockout js to construct my application with asp.net mvc 4 on the backend.  We are using knockout.mapping to populate the observables from MVC Service calls</p>
  
  <p>Now I'm trying to add validation using the Knockout.Validation plugin as follows:  </p>
  
  <pre><code>self.sDetail(ko.mapping.fromJS(s));
  var validationOptions = { 
                            insertMessages: true, 
                            decorateElement: true,      
                            errorElementClass: 'errorFill' 
                           };
  ko.validation.init(validationOptions);
  self.sDetail.Year.extend({ required: true });
  </code></pre>
  
  <p>When I run it I get the following error:</p>
  
  <pre><code>Error: Unable to get property 'extend' of undefined or null reference
  </code></pre>
  
  <p>When I debug I find that the sDetail appears empty.  When I applyBindings the inputs are populated correctly.  At what point to I have access to the propertys of the ko viewmodel.  Is there a way around this issue?</p>