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.Model#destroyRecord()

destroyRecord (options) Promise Defined in addon/-private/system/model/model.js:532 Same as deleteRecord, but saves the record immediately. Example app/routes/model/delete.js import Ember from 'ember'; export default Ember.Route.extend({ actions: { delete: function() { var controller = this.controller; controller.get('model').destroyRecord().then(function() { controller.transitionToRoute('model.index'); }); } } }); If you pass an object on the adapter

TextSupport#keyUp()

keyUp (event) private Defined in packages/ember-views/lib/mixins/text_support.js:294 Allows you to specify a controller action to invoke when a key-up event is fired. To use this method, give your field a key-up attribute. The value of that attribute should be the name of the action in your controller that you wish to invoke. For an example on how to use the key-up attribute, please reference the example near the top of this file. Parameters: event Event

RSVP.Promise#finally()

finally (callback, label) Promise Defined in bower_components/rsvp/lib/rsvp/promise.js:442 finally will be invoked regardless of the promise's fate just as native try/catch/finally behaves Synchronous example: findAuthor() { if (Math.random() > 0.5) { throw new Error(); } return new Author(); } try { return findAuthor(); // succeed or fail } catch(error) { return findOtherAuther(); } finally { // always runs // doesn't affect the return value } Asynchronous example: f

Debugging Promises

Debugging Promises The Inspector provides a way to look at all Promises created in your application. Click on the Promises menu to start inspecting them. You can see a hierarchical list of Promises with labels describing each Promise, its state, its settled value, and the time it took to settle. Promise States and Filtering Promises have different colors based on their state. You can filter by clicking on the following pills: Rejected, Pending, Fulfilled. You can also search for Promises

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

DS.RESTAdapter#isInvalid()

isInvalid (status, headers, payload) Boolean Defined in addon/adapters/rest.js:960 Available since 1.13.0 Default handleResponse implementation uses this hook to decide if the response is a an invalid error. Parameters: status Number headers Object payload Object Returns: Boolean

DS.RecordArray#addInternalModel()

addInternalModel (internalModel, an) private Defined in addon/-private/system/record-arrays/record-array.js:142 Adds an internal model to the RecordArray without duplicates Parameters: internalModel InternalModel an Number optional index to insert at

DS.EmbeddedRecordsMixin

DS.EmbeddedRecordsMixin Class Defined in: addon/serializers/embedded-records-mixin.js:8 Module: ember-data Using Embedded Records DS.EmbeddedRecordsMixin supports serializing embedded records. To set up embedded records, include the mixin when extending a serializer, then define and configure embedded (model) relationships. Below is an example of a per-type serializer (post type). app/serializers/post.js import DS from 'ember-data'; export default DS.RESTSerializer.extend(DS.EmbeddedRecor

Observable#propertyWillChange()

propertyWillChange (keyName) Ember.Observableprivate Defined in packages/ember-runtime/lib/mixins/observable.js:270 Notify the observer system that a property is about to change. Sometimes you need to change a value directly or indirectly without actually calling get() or set() on it. In this case, you can use this method and propertyDidChange() instead. Calling these two methods together will notify all observers that the property has potentially changed value. Note that you must always ca