Reputation: 2256
I do this to filter my products by brand:
angular.extend(brandProducts,
$filter('filter')(productDb, { 'brand': brand.name }));
How do I filter for price >= x && price <= y?
Upvotes: 0
Views: 24
Reputation: 5293
You do not need the AngularJS filters in your JavaScript, you can simply use JavaScript array untilities as follows :
let filteredProductDb = productDb.filter((prod) => {
return (prod.brand === brand.name && prod.price >= x && prod.price <= y);
});
angular.extend(brandProducts, filteredProductDb);
Upvotes: 2