query (store, type, query, recordArray) Promise
This method is called when you call query
on the store.
Example
app/adapters/application.js
import DS from 'ember-data'; export default DS.Adapter.extend({ query: function(store, type, query) { 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
-
query
Object
-
recordArray
DS.AdapterPopulatedRecordArray
Returns:
-
Promise
- promise
Please login to continue.