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
});
doc_EmberJs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.