title: How to filter a row in AngularJS based on data in a particular 'td'
body: <p>I have a table made in AngularJS and I am trying to learn <strong>SortBy</strong> and <strong>Filter</strong> options.</p>
  
  <p>I want to sort the table based on data in a particular TD. I don't want to filter by inputting a filter manually, but I want to hardcode that filter to the table.</p>
  
  <p>My current table is :</p>
  
  <pre><code>&lt;table ng-table="talentPoolList" show-filter="true" class="table table-striped table-bordered"&gt;
      &lt;tr ng-repeat="employee in data | filter: testFilter"&gt;
  
          &lt;td data-title="'#'"&gt;{{$index + 1}}&lt;/td&gt;
          &lt;td data-title="'First Name'" sortable="'employee.employee.firstName'" filter="{ 'employee.employee.firstName': 'text' }"&gt;
              {{employee.employee.firstName}}
          &lt;/td&gt;
          &lt;td data-title="'Last Name'" sortable="'employee.employee.lastName'" filter="{ 'employee.employee.lastName': 'text' }"&gt;
              {{employee.employee.lastName}}
          &lt;/td&gt;
          &lt;td data-title="'Current State'" sortable="'currentState'" filter="{ 'currentState': 'text' }"&gt;
              {{employee.state.state}}
          &lt;/td&gt;
          &lt;td data-title="'Reserve to (state):'" ng-if="employee.state.state == 'Available' "&gt;
              &lt;select&gt;
                  &lt;option disabled selected value&gt; -- select an option -- &lt;/option&gt;
                  &lt;option id="123"&gt;123&lt;/option&gt;
                  &lt;option id="234"&gt;234&lt;/option&gt;
                  &lt;option id="345"&gt;345&lt;/option&gt;
                  &lt;option id="456"&gt;456&lt;/option&gt;
                  &lt;option id="567"&gt;567&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>In the above table, I want the filtering to be done based on the :</p>
  
  <pre><code>&lt;td data-title="'Current State'" sortable="'currentState'" filter="{ 'currentState': 'text' }"&gt;
      {{employee.state.state}}
  &lt;/td&gt;
  </code></pre>
  
  <p><code>{{employee.state.state}}</code> returns several values. They can be any one of the following :
   1. Available
   2. Resigned
   3. OnNotice
   4. Blocked
   5. Accepted
   6. Rejected
   7. Shadow</p>
  
  <p>I want the table to only display the states Available and Blocked..</p>
  
  <p>My Controller is:</p>
  
  <pre><code>'use strict';
  
  angular.module('employeeTalentPool', []);
  
  //Routers
  myApp.config(function ($stateProvider) {
      $stateProvider.state('employeeTalentPool', {
          url: '/employeeTalentPool',
          templateUrl: 'partials/talentPoolEmployees/employeeTalentPool.html',
          data: {
              auth: true
          }
      });
  
  });
  
  //Factories
  myApp.factory('employeeTalentPoolServices', ['$http', function ($http) {
  
      var factoryDefinitions = {
          //getAllBenchers: function () {
          //    return $http.get(myApp.TalentPoolBaseUrl + '/EmployeeState?state=Available&amp;pageNumber=1&amp;pageSize=5').success(function (data) { return data; });
          //            },
          getAllBenchers: function () {
              return $http.get(myApp.TalentPoolBaseUrl + '/EmployeeState?state=&amp;pageNumber=0&amp;pageSize=0').success(function (data) { return data; });
                       },
          reserveEmployee: function () {
              return $http.post('').success(function (data) { return data;});
          }
  
  
      }
  
      return factoryDefinitions;
  }
  ]);
  
  //Controllers
  
  myApp.controller('getAllBenchersController', ['$scope', 'employeeTalentPoolServices', function ($scope, employeeTalentPoolServices) {
      employeeTalentPoolServices.getAllBenchers().then(function (result) {
          $scope.data = result.data;
          $scope.testFilter = function (item) {
              return (item.state.state.toLowerCase() === 'available' || item.state.state.toLowerCase() === 'rejected');
          }
      });
  
  }]);
  </code></pre>
  
  <p>Can anyone help me with creating a hard coded filter in the table that will show only those two states?</p>
  
  <p>Thank You</p>