kumara
kumara

Reputation: 937

angular js drop down value order change

I need to change drop down value order. this is my drop down

<select ng-model="reportSearch.charityId">
    <option value="">--- All Charity ---</option>
    <option  ng-repeat="item in charityList | orderBy:'+value'">
      {{item.value}}
    </option> 
</select>

this is the my demo. in my demo i need to 'Engagement1 Name' show as the 5th option in the drop down. how i change that order.

Demo

Upvotes: 1

Views: 29

Answers (1)

Sujeet Sinha
Sujeet Sinha

Reputation: 2433

You can sort by the key.

<option  ng-repeat="item in charityList | orderBy:'+key'">{{item.value}}</option> 

Upvotes: 1

Related Questions