DS.PromiseArray

DS.PromiseArray Class

Extends: Ember.ArrayProxy

Uses: Ember.PromiseProxyMixin

Defined in: addon/-private/system/promise-proxies.js:7

Module: ember-data

A PromiseArray is an object that acts like both an Ember.Array and a promise. When the promise is resolved the resulting value will be set to the PromiseArray's content property. This makes it easy to create data bindings with the PromiseArray that will be updated when the promise resolves.

For more information see the Ember.PromiseProxyMixin documentation.

Example

var promiseArray = DS.PromiseArray.create({
  promise: $.getJSON('/some/remote/data.json')
});

promiseArray.get('length'); // 0

promiseArray.then(function() {
  promiseArray.get('length'); // 100
});
doc_EmberJs
2016-11-30 16:50:19
Comments
Leave a Comment

Please login to continue.