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