title: Reusing Form snippets in AngularJS
body: <p>What is the best way to go about creating a small bit of HTML Form elements and reusing that as a snippet multiple times in a form, but with different models?</p>
  
  <p>e.g. inputs for firstName, lastName, streetAddress, city, state, zip for student, parent, pointOfContact</p>
  
  <p>If I was hard-coding the model and inputs, I would have something like:</p>
  
  <pre><code>&lt;input name="student.firstName" ng-model="student.firstName" &gt;
  &lt;input name="student.lastName" ng-model="student.lastName" &gt;
  &lt;input name="parent.firstName" ng-model="parent.firstName" &gt;
  &lt;input name="parent.lastName" ng-model="parent.lastName" &gt;
  &lt;input name="pointOfContact.firstName" ng-model="pointOfContact.firstName" &gt;
  &lt;input name="pointOfContact.lastName" ng-model="pointOfContact.lastName" &gt;
  </code></pre>
  
  <p>As a angularJs noob, I'm not sure how to do $modelPrefix.firstName</p>
  
  <p><strong>Template ?</strong></p>
  
  <pre><code>&lt;input name="$modelPrefix.firstName" ng-model="$modelPrefix.firstName" &gt;
  &lt;input name="$modelPrefix.lastName" ng-model="$modelPrefix.lastName" &gt;
  </code></pre>