title: How to push entered ng-model values to table in Angular?
body: <p>I am attempting to populate json data to table using ng-repeat via clickButton function.  I have 2 fields (firstName/lastName).  I would like to enter either firstName or lastName to push all results to table.  Is it this js function?</p>
  
  <p><strong>js function</strong></p>
  
  <pre><code>$scope.clickButton = function(enteredValue) {
  
  $scope.reset();
  $scope.items = data;
  
  angular.forEach($scope.items, function (item) {
      if(item.fname === enteredValue || item.lname === enteredValue ){
          $scope.results.push({
              first: item.fname,
              last: item.lname,
              address: item.address,
              phone: item.phone
  
          });
  </code></pre>
  
  <p><strong>jsp</strong></p>
  
  <pre><code> &lt;input id="fName" name="fName" type="text" data-ng-model="enteredValue.firstName" /&gt;
  
   &lt;input id="lName" name="lName" type="text" data-ng-model="enteredValue.lastName" /&gt; 
  
   &lt;button class="btn btn-primary" data-ng-click='clickButton(enteredValue)'&gt;Button&lt;/button&gt;
  </code></pre>
  
  <p>Here's <a href="http://plnkr.co/edit/1grEZ1TQt3tFmiFPr3ut?p=preview" rel="nofollow">Plnkr</a>.</p>