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'
});
doc_EmberJs
2016-11-30 16:50:09
Comments
Leave a Comment

Please login to continue.