AngularJS: how to order by dropdown
How to sort dropdown in angularjs?
by chauhan bharat
HTML
<div ng-app="myApp" ng-controller="Ctrl">
<select ng-model="reportSearch.charityId">
<option value="">--- All Charity ---</option>
<option ng-repeat="(key, value) in charityList | orderBy:value" value="{{key}}">{{value}}</option>
</select>
</div>
JavaScript
angular.module('myApp', [])
.controller('Ctrl', function($scope) {
$scope.charityList = {
"1": "softweb charity",
"2": "charity 1",
"3": "charity update",
"4": "Engagement1 Name",
"6": "United Way Enagagement",
"7": "Indian Noble Charity"
}
});