RecordArray Class
A record array is an array that contains records of a certain modelName. The record
array materializes records as needed when they are retrieved for the first
time. You should not create record arrays yourself. Instead, an instance of
RecordArray
or its subclasses will be returned by your application's store
in response to queries.
Item Index
Properties
Methods
_pushInternalModels
-
internalModel
Adds an internal model to the RecordArray
without duplicates
Parameters:
-
internalModel
InternalModel
_unregisterFromManager
()
private
objectAtContent
-
index
Retrieves an object from the content by index.
Parameters:
-
index
Number
Returns:
record
removeInternalModel
-
internalModel
Removes an internalModel to the RecordArray
.
Parameters:
-
internalModel
InternalModel
save
()
PromiseArray
Saves all of the records in the RecordArray
.
Example
var messages = store.peekAll('message');
messages.forEach(function(message) {
message.set('hasBeenSeen', true);
});
messages.save();
Returns:
promise
update
()
Used to get the latest version of all of the records in this array from the adapter.
Example
var people = store.peekAll('person');
people.get('isUpdating'); // false
people.update().then(function() {
people.get('isUpdating'); // false
});
people.get('isUpdating'); // true
Properties
content
Ember.Array
private
The array of client ids backing the record array. When a record is requested from the record array, the record for the client id at the same index is materialized, if necessary, by the store.
isLoaded
Boolean
The flag to signal a RecordArray
is finished loading data.
Example
var people = store.peekAll('person');
people.get('isLoaded'); // true
isUpdating
Boolean
The flag to signal a RecordArray
is currently loading data.
Example
var people = store.peekAll('person');
people.get('isUpdating'); // false
people.update();
people.get('isUpdating'); // true