ComputedProperty#readOnly()

readOnlyEmber.ComputedPropertypublic

Defined in packages/ember-metal/lib/computed.js:193

Call on a computed property to set it into read-only mode. When in this mode the computed property will throw an error when set.

let Person = Ember.Object.extend({
  guid: Ember.computed(function() {
    return 'guid-guid-guid';
  }).readOnly()
});

let person = Person.create();

person.set('guid', 'new-guid'); // will throw an exception

Returns:

Ember.ComputedProperty
this
doc_EmberJs
2016-11-30 16:48:51
Comments
Leave a Comment

Please login to continue.