title: Angular2 - bind ngModel to a reference of a property
body: <p>I have a long list of user inputs, and would like to store these in an object instead of spelling them out in HTML. I want to bind these values to another object that stores the user/customer's data. Preferably using ngModel due to its simplicity and functionality.</p>
  
  <p>Anyone knows how I can achieve this?</p>
  
  <p>Example below (not working).</p>
  
  <pre class="lang-ts prettyprint-override"><code>@Component({
    template: `
      &lt;div&gt;
        &lt;h2&gt;NgModel Example&lt;/h2&gt;
        &lt;div *ngFor="let input of inputList"&gt;
          {{ input.label }} &lt;input type="text" [(ngModel)]="input.bindTo"&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;p&gt;This is not working: {{customerInfo.name}}, {{customerInfo.email}}&lt;/p&gt;
    `,
    directives: [...]
  })
  
  export class AppComponent {
    inputList = [
      {
        label: "Enter your name",
        bindTo: this.customerInfo.name  // also tried 'customerInfo.name'
      },
      {
        label: "Enter your email",
        bindTo: this.customerInfo.email
      }
    ]  
  
    customerInfo = {
      name: 'test',
      email: ''
    }
  }
  </code></pre>