title: ember.js #each order by property
body: <p>I have an array of <code>Ember.Object</code>s which is displayed by Handlebars <code>{{#each}}</code> helper which I want to be sorted by an property of those objects everytime the array changes.</p>
  
  <p>So something like this:</p>
  
  <pre><code>var arr = [
      Ember.Objects.create({
          position:0,
          label:"foo"
      }),
      Ember.Objects.create({
          position:1,
          label:"bar"
      }),
  ];
  </code></pre>
  
  <p>And the handlebar</p>
  
  <pre><code>{{#each arr}}
      &lt;div class="label"&gt;{{label}}&lt;/div&gt;
  {{/each}}
  </code></pre>
  
  <p>So if I update the positions and the <code>bar</code> object becomes first, I want the view to be updated. Can I depend the <code>{{#each}}</code> Helper on an property?</p>