Answer the question
In order to leave comments, you need to log in
How to implement sorting in Angular?
Hello, please tell me how to sort from the dropdown list. This list includes countries producing goods.
<select ng-model="model.country">
<option value="Украина">Zero</option>
<option value="Беларусь">One</option>
<option value="Россия">Two</option>
</select>
<div class="product_ramka" ng-repeat="product in products| filter:enterName |orderBy:'price':reverse">
<p>Страна: {{product.country}}</p>
Answer the question
In order to leave comments, you need to log in
https://docs.angularjs.org/api/ng/filter/orderBy
In your case, reverse will be looked up in the scope context.
Either write orderBy:'price':true or declare $scope.reverse = true.
// UPD
In your case, I would have a filter function. More details on google.
stackoverflow.com/questions/26400113/angularjs-dyn...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question