Here is a simple working Fiddle of what your try to achieve. It does filter your object by attribute genre where you can search for the Id in the text field. For example 8.
Take a look at the filter declaration filter:{genre:searchGenre} which holds the attribute name genre to filter and the model input searchGenre. For more information please take a look at the AngularJS Documentation of filter.
The following example shows how to filter in View - Fiddle demo
View
<div ng-controller="MyCtrl">
<h1>Filter items</h1>
<input type="text" ng-model="searchGenre">
<h2>Genres</h2>
<div ng-repeat="genre in genres | filter:{genre:searchGenre}">
{{genre.label}}
</div>
</div>
AngularJS app
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.genres = [{
label: "Trance",
genre: "8",
position: 8
}, {
label: "House",
genre: "2",
position: 8
}];
}
The following example shows how to filter in an controller - Fiddle demo
View
<div ng-controller="MyCtrl">
<div>Filter items</div>
<input type="text" ng-model="searchGenre">
<div>Genres</div>
<div ng-repeat="genre in filtered">
{{genre.label}}
</div>
</div>
AngularJS App
var myApp = angular.module('myApp',[]);
function MyCtrl($scope, filterFilter) {
$scope.genres = [{
label: "Trance",
genre: "8",
position: 8
}, {
label: "House",
genre: "2",
position: 8
}];
//init search phrase
$scope.searchGenre = '';
//init filtered scope
$scope.filtered = [];
/**
* Watch keyword change
*/
$scope.$watch('searchGenre', function(term) {
$scope.filtered = filterFilter($scope.genres, {'genre': term});
});
}