我嘗試通過下拉使用angularjs進行排序。但排序不起作用。請幫幫我。請檢查此鏈接:jsfiddle如何在angularjs中對下拉列表進行排序?
HTML: 我的HTML代碼這裏
<select ng-options="key as value for (key, value) in charityList | orderBy:'value'" ng-model="reportSearch.charityId">
<option value="">All Charity</option>
</select>
JSON數組:的json 「鍵=>值」 陣列使用下拉列表
$scope.charityList = {
"1": "softweb charity",
"2": "charity 1",
"3": "charity update",
"4": "Engagement1 Name",
"6": "United Way Enagagement",
"7": "Indian Noble Charity"
}
請檢查這個鏈接:jsfiddle
要通過鑰匙或值對列表進行排序? – Harshad