Answer the question
In order to leave comments, you need to log in
How do simple filters work in Angular?
Hello, there are 2 options, both do only one half of the work, but I don’t know how to combine)
<tr ng-repeat="product in products | filter:query | orderBy:predicate | orderBy:price">
The first option sorts everything and outputs perfectly. But<h1 ng-show="products.length == 0">Empty products</h1>
This line displays the entire number of products in the array. (And not the number remaining after sorting) Plus the button<a href="#" class="btn btn-danger" ng-click="clear()">Clear</a>
Does not reset the filter. <tr ng-repeat="product in products = (products | filter:query | orderBy:predicate | orderBy:price)">
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question