title: How to filter by a specific field in an object array using $filter('filter')
body: <p>I would like to filter an employee object array using $filter('filter') to filter the results based on an employee's first name field ONLY that can be selected from the drop down/select.  Notes that I do NOT want to use the "| filter:" in the ng-repeat".  </p>
  
  <p>The difficulty is that the name field is a property of another field called 'details', so I can't details.name like the code below because it will error.</p>
  
  <pre><code>$scope.filteredEmployees = $filter('filter')(employees, {details.name: selectedName }); 
  </code></pre>
  
  <p>See below for structure of the employee array object. </p>
  
  <p>How can I tell it to filter the records based on details.name field using $filter('filter')?</p>
  
  <p>Thank you in advance for your help!</p>
  
  <p><strong>Here is the code:</strong></p>
  
  <pre><code>Var selectedName = “An”;
  $scope.filteredEmployees = $filter('filter')(employees, {**details.name:** selectedName });
  Var employees  = [
        {
          Date: 01/01/2012
          details: {
            name: ‘An’,
        age: 25
  
          }
        },
        {
          Date: 01/01/2012
          details: {
            name: ‘'Bill',
        age: 20
  
          }
              }];
  
      //Here is 
      &lt;select ng-model="selectedName" ng-options="e for e in employees" data-ng-show="employees.length &gt; 0" ng-change="filterEmployees"&gt;
          &lt;option value=""&gt;All Employees&lt;/option&gt;
      &lt;/select&gt;&lt;br&gt;
  
      function filterEmployees()  {
          $scope.filteredEmployees = $filter('filter')(employees, "Joe");
      };
  </code></pre>