Q:

dynamic filter with dynamic content Angularjs

I would like to apply filter on products by catergory but i don't know how to do. 
Here my HTML 
<tr ng-repeat="product in products | filter:search">

And here my filter : 
 <li role="presentation" ng-repeat="category in categories">
 <a ng-click="FILTER WITH CAT NAME">{{category.name}}</a>

Here my controller where i receive data : 
$http.get('http://localhost:3000/api/allProducts').
success(function(data, status, headers, config) {
    console.log('------------ ProductsCtrl', data);
    console.log(data);

    $scope.products = data.products;
    $scope.categories = data.category;

    $scope.productsLength = data.products.length;
}).
error(function(data, status, headers, config) {
    //
});

Someone can explain me how to do please i tried many things / times but nothing work for me...
thanks

A:

I assume your list of products contain product objects with a category property. Add a select for your categories:
<select ng-model="selectedCategory" >
   <option ng-repeat="category in categories" value="{{category}}">{{category}}</option>
</select>

Then you can filter the products like this:
<div ng-repeat="product in products | filter:category=selectedCategory">
  ...
</div>

