findAll (store, type, sinceToken, snapshotRecordArray) Promise
The findAll()
method is used to retrieve all records for a given type.
Example
app/adapters/application.js
import DS from 'ember-data'; export default DS.Adapter.extend({ findAll: function(store, type, sinceToken) { var query = { since: sinceToken }; return new Ember.RSVP.Promise(function(resolve, reject) { Ember.$.getJSON(`/${type.modelName}`, query).then(function(data) { resolve(data); }, function(jqXHR) { reject(jqXHR); }); }); } });
Parameters:
-
store
DS.Store
-
type
DS.Model
-
sinceToken
String
-
snapshotRecordArray
DS.SnapshotRecordArray
Returns:
-
Promise
- promise
Please login to continue.