title: Initializing the input form in AngularJS using value from scope variable
body: <p>How do I initialize a form to values from other <code>$scope</code> variable in AngularJS?
  I know that I have to use <code>ng-init</code> to achieve that but instead of initializing it to values I have to initialize that to value in the variable.</p>
  
  <p>I have <code>$scope.User</code> containing all the details of the user, so when the data comes back I want that to fed into respective fields. For example <code>$scope.User.FirstName</code> gets fed into FirstName input field.</p>
  
  <pre><code>&lt;label&gt;FirstName:&lt;/label&gt;
  &lt;input type="text" id="FirstName" required ng-model="newUser.FirstName" ng-init="newUser.FirstName='User.FirstName'"/&gt;
  </code></pre>