title: Model variables remain undefined if not edited in the partial: Angularjs
body: <p>I have a <code>ng-model="name"</code> in the partial and in the controller inside a function I create an object like:</p>
  
  <pre><code>var data= {};
  data['name'] = $scope.name;
  </code></pre>
  
  <p>But on the execution of the code the data remains an empty object as the $scope.name remains undefined.</p>
  
  <ol>
  <li>How to resolve this ?</li>
  <li>I have many vars in the partial and I will like to use them directly without having to declare them first.</li>
  </ol>