尝试根据价格和评级(在返回的对象中)进行排序。我宁愿做一个 ng-click an li 而不是使用选择菜单。有没有办法做到这一点?我一直在环顾四周,这是我想出的最接近的。
<ul class="restaurant-filter">
<li> <i class="icon-search"></i>Organize results by "Price" & "Rating"…
<ul ng-model="priceAndRating">
<li ng-click="price">Price</li>
<li ng-click="rating">Rating</li>
</ul>
</li>
</ul>
<ul class="available-restaurants">
<li ng-repeat="restaurant in availableRestaurants | orderBy:priceAndRating" ng-click="addRestaurantToEvent(restaurant.restaurantName)">
<h6>{{restaurant.restaurantName}}</h6>
<p>label one two three for five six</p>
<i class="icon-chevron-right"></i>
</li>
</ul>
availableRestaurants 是我的对象。