How to delete a property from an Emberjs Object?


Plain old Javascript object properties can be deleted like so...

var foo = {bar: 'baz'};
delete foo.bar

How do you delete (not just set to null) a property in an Ember object?

var foo = Ember.Object.create({bar: 'baz'});
foo.set('bar', undefined)

This will delete the attribute and trigger any observer


The same as a normal object:

delete foo.bar