Is there a way to efficiently update an Ember Array so that changes in the array reflect in the view?
Take a look at this simplified code snippet -
cacheArr: Em.A([]),
count: 1,
updateFxn: function() {
this.incrementProperty(count);
devObj = Ember.object.create();
Ember.set(devObj,"ts", this.count);
this.cacheArr.replace(0,1, [devObj]);
},
App.ArrayComponent = Ember.Component.extend({
refresh: function() {
return cacheArr;
}.property('localModel.length')
});
<script type="text/x-handlebars" id="components/new-comp">
{{#each item in refresh}}
{{item.ts}}
{{/each}}
</script>
I'm puzzled by the exception I encountered: Cannot read property 'destroy' of undefined. Despite my efforts, I haven't been able to find a solution. Any suggestions would be greatly appreciated.