W3cubDocs

/Ember.js

DS.AdapterPopulatedRecordArray Class

Extends: DS.RecordArray

Defined in: addon/-private/system/record-arrays/adapter-populated-record-array.js:11

Module: ember-data

Represents an ordered list of records whose order and membership is determined by the adapter. For example, a query sent to the adapter may trigger a search on the server, whose results would be loaded into an instance of the AdapterPopulatedRecordArray.

If you want to update the array and get the latest records from the adapter, you can invoke update():

Example

// GET /users?isAdmin=true
var admins = store.query('user', { isAdmin: true });

admins.then(function() {
  console.log(admins.get("length")); // 42
});

// somewhere later in the app code, when new admins have been created
// in the meantime
//
// GET /users?isAdmin=true
admins.update().then(function() {
  admins.get('isUpdating'); // false
  console.log(admins.get("length")); // 123
});

admins.get('isUpdating'); // true

_setInternalModels (internalModels, payload) private

Defined in addon/-private/system/record-arrays/adapter-populated-record-array.js:69

Parameters:

internalModels Array
payload Object
normalized payload

© 2017 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
http://emberjs.com/api/data/classes/DS.AdapterPopulatedRecordArray.html