DS.Model#hasDirtyAttributes

hasDirtyAttributes{Boolean}

Defined in addon/-private/system/model/model.js:101
Available since 1.13.0

If this property is true the record is in the dirty state. The record has local changes that have not yet been saved by the adapter. This includes records that have been created (but not yet saved) or deleted.

Example

var record = store.createRecord('model');
record.get('hasDirtyAttributes'); // true

store.findRecord('model', 1).then(function(model) {
  model.get('hasDirtyAttributes'); // false
  model.set('foo', 'some value');
  model.get('hasDirtyAttributes'); // true
});
doc_EmberJs
2016-11-30 16:50:08
Comments
Leave a Comment

Please login to continue.