Observers

Observers Ember supports observing any property, including computed properties. Observers should contain behavior that reacts to changes in another property. Observers are especially useful when you need to perform some behavior after a binding has finished synchronizing. Observers are often over-used by new Ember developers. Observers are used heavily within the Ember framework itself, but for most problems Ember app developers face, computed properties are the appropriate solution. You can

Test.Adapter#asyncEnd()

asyncEndpublic Defined in packages/ember-testing/lib/adapters/adapter.js:30 This callback will be called whenever an async operation has completed.

TextSupport.isView

isViewBooleanprivatestatic Defined in packages/ember-views/lib/mixins/template_support.js:9 Default: true

Enumerable#sortBy()

sortBy (property) Arraypublic Defined in packages/ember-runtime/lib/mixins/enumerable.js:1047 Available since 1.2.0 Converts the enumerable into an array and sorts by the keys specified in the argument. You may provide multiple arguments to sort by multiple properties. Parameters: property String name(s) to sort on Returns: Array The sorted array.

Registry#_options

_optionsInheritingDictprivate Defined in packages/container/lib/registry.js:123

Finding Records

Finding Records The Ember Data store provides an interface for retrieving records of a single type. Retrieving a Single Record Use store.findRecord() to retrieve a record by its type and ID. This will return a promise that fulfills with the requested record: var blogPost = this.get('store').findRecord('blog-post', 1); // => GET /blog-posts/1 Use store.peekRecord() to retrieve a record by its type and ID, without making a network request. This will return the record only if it is already p

DS.Store#findAll()

findAll (modelName, options) Promise Defined in addon/-private/system/store.js:1258 Available since 1.13.0 findAll asks the adapter's findAll method to find the records for the given type, and returns a promise which will resolve with all records of this type present in the store, even if the adapter only returns a subset of them. app/routes/authors.js import Ember from 'ember'; export default Ember.Route.extend({ model: function(params) { return this.store.findAll('author'); } });

DS.Model#didDefineProperty()

didDefineProperty (proto, key, value) Defined in addon/-private/system/relationships/ext.js:102 This Ember.js hook allows an object to be notified when a property is defined. In this case, we use it to be notified when an Ember Data user defines a belongs-to relationship. In that case, we need to set up observers for each one, allowing us to track relationship changes and automatically reflect changes in the inverse has-many array. This hook passes the class being set up, as well as the ke

DS.Model#adapterDidDirty()

adapterDidDirtyprivate Defined in addon/-private/system/model/model.js:655

Pushing Records into the Store

Pushing Records into the Store One way to think about the store is as a cache of all of the records that have been loaded by your application. If a route or a controller in your app asks for a record, the store can return it immediately if it is in the cache. Otherwise, the store must ask the adapter to load it, which usually means a trip over the network to retrieve it from the server. Instead of waiting for the app to request a record, however, you can push records into the store's cache ah