Skip to content

Instantly share code, notes, and snippets.

@manoharank
Last active December 23, 2015 10:49
Show Gist options
  • Save manoharank/6624449 to your computer and use it in GitHub Desktop.
Save manoharank/6624449 to your computer and use it in GitHub Desktop.
computedArray: function() {
var self = this;
ajax('/someurl').then(function(jsonArray) {
self.set('computedArray', jsonArray);
});
}.property()
// Better way
computedArray: function() {
var array = Ember.ArrayProxy.create();
ajax('/someurl').then(function(jsonArray) {
array.set('content', jsonArray);
});
return array;
}.property()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment