I want to make search based on ID using angularjs filter. I am generating some value based on ID of node like based on userId I am finding name, phone no of user from storage JSON object.

But I am not able to find how to filter result if i have just ID and its JSON object.

I have made jsfiddle to get clear idea about my issue <http://jsfiddle.net/U3pVM/5969/>

**HTML**

```
<div ng-app ng-controller="Ctrl">
Search: <input ng-model="searchTableQuery.id">
<table id="searchTextResults" class="table table-bordered">
  <tr><th>Name</th></tr>
  <tr ng-repeat="friend in friends | filter:searchTableQuery">
    <td>{{getCurrentValue(friend.id, friends)}}</td>
  </tr>
</table>
</div>

```

**JS**

```
function Ctrl($scope) {
    $scope.friends = [{id: 1, name:'John', phone:'555-1276'},
                         {id: 2, name:'Mary', phone:'800-BIG-MARY'},
                         {id: 3, name:'Mike', phone:'555-4321'},
                         {id: 4, name:'Adam', phone:'555-5678'},
                         {id: 5, name:'Julie', phone:'555-8765'},
                         {id: 6, name:'Juliette', phone:'555-5678'}];
    $scope.getCurrentValue = function (id, availableData) {
        var result = _.where(availableData, { 'id': id });
        if (_.isEmpty(result)) {
            result = [{id:0,value:""}];
        };
        return result[0].name;
    }
}

```

How to make filter on table using ID of node in angularjs?