title: ng-model set date in form
body: <p>i want to set a date in <code>ng-model</code>.</p>
  
  <p>this works fine:</p>
  
  <pre><code>&lt;input type="date" class="form-control" ng-model="myDate.value" placeholder="yyyy-MM-dd"  /&gt;
  </code></pre>
  
  <p>controller:</p>
  
  <pre><code>$scope.myDate = {
       value: new Date(2015, 9, 22)
   };
  </code></pre>
  
  <p><strong>But i want this to work</strong></p>
  
  <pre><code>$scope.myFormObj.myDate = {
       value: new Date(2015, 9, 22)
   };
  
  &lt;input type="date" class="form-control" ng-model="myFormObj.myDate.value" placeholder="yyyy-MM-dd"  /&gt;
  </code></pre>
  
  <p>The <code>ng-model</code> is in this case <strong>myFormObj.myDate</strong></p>
  
  <p>I need this syntax because after submit i save all data in <code>myFormObj-json</code> object like <code>myFormObj</code>.name and so on.</p>
  
  <p>i get the error:</p>
  
  <pre><code> Cannot set property 'myDate' of undefined
  </code></pre>