DS.Model#isSaving

isSaving{Boolean} Defined in addon/-private/system/model/model.js:128 If this property is true the record is in the saving state. A record enters the saving state when save is called, but the adapter has not yet acknowledged that the changes have been persisted to the backend. Example var record = store.createRecord('model'); record.get('isSaving'); // false var promise = record.save(); record.get('isSaving'); // true promise.then(function() { record.get('isSaving'); // false });

DS.Model#isReloading

isReloading{Boolean} Defined in addon/-private/system/model/model.js:265 If true the store is attempting to reload the record form the adapter. Example record.get('isReloading'); // false record.reload(); record.get('isReloading'); // true

DS.Model#isNew

isNew{Boolean} Defined in addon/-private/system/model/model.js:189 If this property is true the record is in the new state. A record will be in the new state when it has been created on the client and the adapter has not yet report that it was successfully saved. Example var record = store.createRecord('model'); record.get('isNew'); // true record.save().then(function(model) { model.get('isNew'); // false });

DS.Model#isLoading

isLoading{Boolean} Defined in addon/-private/system/model/model.js:68 If this property is true the record is in the loading state. A record enters this state when the store asks the adapter for its data. It remains in this state until the adapter provides the requested data.

DS.Model#isLoaded

isLoaded{Boolean} Defined in addon/-private/system/model/model.js:79 If this property is true the record is in the loaded state. A record enters this state when its data is populated. Most of a record's lifecycle is spent inside substates of the loaded state. Example var record = store.createRecord('model'); record.get('isLoaded'); // true store.findRecord('model', 1).then(function(model) { model.get('isLoaded'); // true });

DS.Model#isError

isError{Boolean} Defined in addon/-private/system/model/model.js:244 If true the adapter reported that it was unable to save local changes to the backend for any reason other than a server-side validation error. Example record.get('isError'); // false record.set('foo', 'valid value'); record.save().then(null, function() { record.get('isError'); // true });

DS.Model#isEmpty

isEmpty{Boolean} Defined in addon/-private/system/model/model.js:54 If this property is true the record is in the empty state. Empty is the first state all records enter after they have been created. Most records created by the store will quickly transition to the loading state if data needs to be fetched from the server or the created state if the record is created on the client. A record can also enter the empty state if the adapter is unable to locate the record.

DS.Model#isDeleted

isDeleted{Boolean} Defined in addon/-private/system/model/model.js:151 If this property is true the record is in the deleted state and has been marked for deletion. When isDeleted is true and hasDirtyAttributes is true, the record is deleted locally but the deletion was not yet persisted. When isSaving is true, the change is in-flight. When both hasDirtyAttributes and isSaving are false, the change has persisted. Example var record = store.createRecord('model'); record.get('isDeleted');

DS.Model#id

id{String} Defined in addon/-private/system/model/model.js:282 All ember models have an id property. This is an identifier managed by an external source. These are always coerced to be strings before being used internally. Note when declaring the attributes for a model it is an error to declare an id attribute. var record = store.createRecord('model'); record.get('id'); // null store.findRecord('model', 1).then(function(model) { model.get('id'); // '1' });

DS.Model#hasMany()

hasMany (name) HasManyReference Defined in addon/-private/system/model/model.js:883 Available since 2.5.0 Get the reference for the specified hasMany relationship. Example // models/blog.js export default DS.Model.extend({ comments: DS.hasMany({ async: true }) }); var blog = store.push({ type: 'blog', id: 1, relationships: { comments: { data: [ { type: 'comment', id: 1 }, { type: 'comment', id: 2 } ] } } }); var commentsRef = blog.hasMany('comm