CoreObject#init()

initpublic Defined in packages/ember-runtime/lib/system/core_object.js:217 An overridable method called when objects are instantiated. By default, does nothing unless it is overridden during class definition. Example: App.Person = Ember.Object.extend({ init: function() { alert('Name is ' + this.get('name')); } }); var steve = App.Person.create({ name: "Steve" }); // alerts 'Name is Steve'. NOTE: If you do override init for a framework class like Ember.View, be sure to call this

Registry#optionsForType()

optionsForType (type, options) private Defined in packages/container/lib/registry.js:356 Allow registering options for all factories of a type. let registry = new Registry(); let container = registry.container(); // if all of type `connection` must not be singletons registry.optionsForType('connection', { singleton: false }); registry.register('connection:twitter', TwitterConnection); registry.register('connection:facebook', FacebookConnection); let twitter = container.lookup('connection

DS.Store#reloadRecord()

reloadRecord (internalModel) Promiseprivate Defined in addon/-private/system/store.js:942 This method is called by the record's reload method. This method calls the adapter's find method, which returns a promise. When that promise resolves, reloadRecord will resolve the promise returned by the record's reload. Parameters: internalModel DS.Model Returns: Promise promise

DS.Model.fields

fieldsEmber.Mapstatic Defined in addon/-private/system/relationships/ext.js:488 A map whose keys are the fields of the model and whose values are strings describing the kind of the field. A model's fields are the union of all of its attributes and relationships. For example: app/models/blog.js import DS from 'ember-data'; export default DS.Model.extend({ users: DS.hasMany('user'), owner: DS.belongsTo('user'), posts: DS.hasMany('post'), title: DS.attr('string') }); import Ember f

DS.Errors#errorsFor()

errorsFor (attribute) Array Defined in addon/-private/system/model/errors.js:136 Returns errors for a given attribute var user = store.createRecord('user', { username: 'tomster', email: 'invalidEmail' }); user.save().catch(function(){ user.get('errors').errorsFor('email'); // returns: // [{attribute: "email", message: "Doesn't look like a valid email."}] }); Parameters: attribute String Returns: Array

Test#visit()

visit (url) RSVP.Promisepublic Defined in packages/ember-testing/lib/helpers.js:24 Loads a route, sets up any controllers, and renders any templates associated with the route as though a real user had triggered the route change while using your app. Example: visit('posts/index').then(function() { // assert something }); Parameters: url String the name of the route Returns: RSVP.Promise

DS.JSONAPISerializer#extractRelationships()

extractRelationships (modelClass, resourceHash) Object Inherited from DS.JSONSerializer but overwritten in addon/serializers/json-api.js:299 Parameters: modelClass Object resourceHash Object Returns: Object

DataAdapter#getRecordFilterValues()

getRecordFilterValues (record) Objectprivate Defined in packages/ember-extension-support/lib/data_adapter.js:458 Returns the values of filters defined by getFilters. Parameters: record Object The record instance. Returns: Object The filter values.

Handling Metadata

Handling Metadata Along with the records returned from your store, you'll likely need to handle some kind of metadata. Metadata is data that goes along with a specific model or type instead of a record. Pagination is a common example of using metadata. Imagine a blog with far more posts than you can display at once. You might query it like so: let result = this.get('store').query('post', { limit: 10, offset: 0 }); To get different pages of data, you'd simply change your offset in increme

DS.SnapshotRecordArray#adapterOptions

adapterOptions{Object} Defined in addon/-private/system/snapshot-record-array.js:46 A hash of adapter options