title: Trying to update one input's value to another's using angularjs
body: <p>I'm fairly new using AngularJS but I've been using for a pet project and I've run in to an issue. What I basically want to do is take the text input from this input field:</p>
  
  <pre><code>&lt;form id="ci_search_form"&gt;
      &lt;p class="input-append"&gt;&lt;label&gt;Search:&lt;/label&gt; &lt;input type="text" id="query" ng:model="query" autofocus&gt; &lt;button ng:click="clearSearch()" class="btn"&gt;&lt;i class="icon-remove"&gt;&lt;/i&gt;&lt;/button&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and update this input field's value with that value:</p>
  
  <pre><code>&lt;div&gt;&lt;input type="text" id="ciquery" ng:model="ciquery.Name"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The second input filters some data and I can type in that directly and it works. However this page will have different sets of data, each with their own search input that I want updated by the master input at the top. I can't set value="" or use jQuery to set the value either, it just appears blank unless I explicitly type in that second input field. Can anyone assist with a solution?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I thought I should include my app and controller code:</p>
  
  <pre><code>var App = angular.module('TicketAssistApp', []);
  
  App.controller('SearchController', function($scope, $http, $filter){
      $scope.query = '';
  
      $http.get('static/ci_list.json').success(function(data){
          $scope.ci_list = data;
      });
  
      $scope.clearSearch = function(){
          $scope.query = '';
      }
  });
  </code></pre>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Made some progress. Created a function that can be called an update ciquery in $scope:</p>
  
  <pre><code>var App = angular.module('TicketAssistApp', []);
  
  App.controller('SearchController', function($scope, $http, $filter){
      $scope.query = '';
      $scope.ciquery = '';
  
      $http.get('static/ci_list.json').success(function(data){
          $scope.ci_list = data;
      });
  
      $scope.queryUpdate = function(){
          $scope.ciquery = $scope.query;
      }
  
      $scope.clearSearch = function(){
          $scope.query = '';
          $scope.queryUpdate();
      }
  });
  </code></pre>
  
  <p>This works great. However, this creates another issue. Before in ciquery I was using ciquery.Name to filter only on the Name attribute. With this new solution I had to change it to this:</p>
  
  <pre><code>&lt;div&gt;&lt;input type="hidden" id="ciquery" ng:model="ciquery"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>This searches all fields in my data which returns unwanted results. Suggestions?</p>