title: multiple inputs based on array
body: <p>My angular experience is basically about 3 days part time, so there's probably something simple I'm missing here.</p>
  
  <p>I'm trying to create a dynamic list of multiple inputs based on an array, which I then want to reference from elsewhere in the app. What I've tried is loading a template from a custom directive, then <code>$compile</code>-ing it.
  <code>
  &lt;input data-ng-repeat="term in query" data-ng-model="term"&gt;
  </code>
  My controller contains <code>$scope.query = [""]</code> which successfully creates the first empty input box. But the input box doesn't seem to update <code>$scope.query[0]</code> when I modify it. This means that when I try to create another empty input box with <code>$scope.query.push("");</code> (from a <code>keypress</code> listener looking for the "/" key) I get a "duplicates not allowed" error.</p>
  
  <p>I've tried manually listening to the inputs and updating <code>scope.$query</code> based on their value, but that doesn't feel very "angular", and results in weird behaviour.</p>
  
  <p>What do I need to do to link these values. Am I along the right lines or way off?</p>