title: AngularJS -- Bind ngModel to an object stored in a property
body: <p>I am trying to populate programatically a list of inputs.</p>
  
  <p>I have something like</p>
  
  <pre><code>&lt;div ng-repeat="field in fields"&gt;
  &lt;input ng-model="field.Binding" /&gt;
  &lt;/div&gt;
  
  var Query = {
      Keywords: "Foo",
      Title: "Bar"
  }
  
  var Fields = [{
      Name: "Keywords",
      Binding: Query.Keywords
  }, {
      Name: "Title",
      Binding: Query.Title
  }];
  
  var myApp = angular.module('myApp', []);
  
  function MyCtrl($scope) {
      $scope.fields = Fields;
      $scope.query = Query;
  }
  </code></pre>
  
  <p>Non-working fiddle @ <a href="http://jsfiddle.net/VSph2/52/" rel="nofollow">http://jsfiddle.net/VSph2/52/</a>
  The string is copied when I start my view, but the two values do not update eachother.</p>
  
  <p>Basicallyk I'd like to bind to an object specified by reference or by name e.g "Query.Keywords" and have the scope evaluate this at runtime -- but I am not having much luck.</p>
  
  <p>As you can see in the fiddle, my values do not stay synchronized.</p>