title: Sorting dropdown alphabetically in AngularJS
body: <p>I'm populating a dropdown through the use of ng-options which is hooked to a controller that in turn is calling a service. Unfortunately the data coming in is a mess and I need to be able to sort it alphabetically.</p>
  
  <p>You figure that something like <code>$.sortBy</code> would do it but unfortunately it didn't do jack. I know I can sort it via javascript with a helper method <code>function asc(a,b)</code> or something like that but I refuse to believe that there is not cleaner way of doing this plus I don't want to bloat the controller with helper methods. It is something so basic in principle so I don't understand why AngularJS doesn't have this.</p>
  
  <p>Is there a way of doing something like <code>$orderBy('asc')</code>?</p>
  
  <p>Example:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;select ng-option="items in item.$orderBy('asc')"&gt;&lt;/select&gt;
  </code></pre>
  
  <p>It would be extremely useful to have options in <code>orderBy</code> so you can do whatever you want, whenever you usually try to sort data. </p>