Filter And Order In Complex Object
<p>I have an array of object as below:</p>

<pre><code>$scope.clients = [
              { client: { name: 'ABC', age: '25' } },
              { client: { name: 'BCD', age: '26' } },
              { client: { name: 'CDE', age: '26' } }
            ];
</code></pre>

<p>And a filter object (actually this are bonded to <strong>ng-model</strong> in the <strong>view</strong>) to <strong>filter</strong> and <strong>order</strong> the array object:</p>

<pre><code> $scope.filterParams = {
                nameSearch: 'ABC',
                order: 'age'
            };
</code></pre>

<p>while i try to update the filter by <code>client.name</code> is does not found anything in the list and the <code>order by</code> also does not work :</p>

<pre><code> $scope.updateFilter = function () {
                var filtered;
                filtered = $filter('filter')($scope.clients, { 'client.name' : $scope.filterParams.nameSearch });
                filtered = $filter('orderBy')(filtered.client, $scope.filterParams.order);

                $scope.filteredList = filtered;
            }

 $scope.$watchCollection('filterParams', function () {
                $scope.updateFilter();
            });
</code></pre>

<p><strong>Can anybody here show me the right direction to filter and order the list?</strong></p>