title: Select2 jQuery Plugin: Is there a way to sort a list of tags alphabetically?
body: <p>I'm using Select2 plugin (<a href="http://ivaynberg.github.io/select2/" rel="noreferrer">http://ivaynberg.github.io/select2/</a>) and as you can see by the list of tags I have in the screenshot, they aren't listed alphabetically and I'd like to be able to do so.</p>
  
  <p><img src="https://i.stack.imgur.com/ynhap.png" alt="enter image description here"></p>
  
  <p>EDIT: This is what I currently have, but instead of query, I want to sort the data (@appTags) via 'text', not 'id':</p>
  
  <pre><code>scope.find('input[name=noun]').select2({
    data: @appTags,
    sortResults: function(results, container, query) {
      if (query.term) {
        return results.sort();
      }
      return results;
    }
  });
  </code></pre>
  
  <p>Screenshots of my Console paused in Debugger:</p>
  
  <p><img src="https://i.stack.imgur.com/4ZB7K.png" alt="enter image description here"></p>
  
  <p>Here's an image of the @appTags object, of which I'd like to sort via 'text':</p>
  
  <p><img src="https://i.stack.imgur.com/Yxxky.png" alt="enter image description here"></p>