我想使用这些字段对产品进行排序。
<select name="cars" class="form-control" ng-model="sortBy">
<option value="volvo">Max: price</option>
<option value="saab">Min: price</option>
<option value="fiat">Date: Newest</option>
<option>Mileage: Highest</option>
<option>Mileage: Lowest</option>
<option value="audi">Year: Oldest</option>
<option value="audi">Year: Newest</option>
</select>
我这样显示了我的数据。但我不知道如何使用上述字段对这些进行排序。
<div class="panel panel-default" style="border: none;box-shadow: 1px 1px 9px 1px #ccc;" ng-repeat="item in getitems_bybrand">
<div class="row">
<div class="col-md-6">
<img ng-repeat="image in item.images | limitTo:1 | orderBy:sortBy" src="http://10.90.90.55/cars_app/backend/public/uploads/@{{image.name}}" class="img-thumbnail" width="400px" height="400px">
</div>
<div class="col-md-6">
<h3><b>@{{ item.cars.year }} @{{ item.cars.name }}</b></h3>
<h5 class="badge">₹ @{{ item.cars.price }},000</h5>
<div class="row">
<div class="col-md-6">
<h5><strong>Mileage :</strong> <span>@{{ item.cars.milage }}</span></h5>
</div>
<div class="col-md-6">
<h5><strong>Specifications :</strong></h5>
<p id="attributes">@{{ item.cars.specifications }}</p>
</div>
</div>
</div>
</div>