• function

removeAttr can.Observe.prototype.removeAttr


Remove a property from an Observe.



  1. attrName {String}

    the name of the property to remove



the value of the property that was removed

removeAttr removes a property by name from an Observe.

var people = new can.Observe({a: 'Alice', b: 'Bob', e: 'Eve'});

people.removeAttr('b'); // 'Bob'
people.attr();          // {a: 'Alice', e: 'Eve'}

Removing an attribute will cause a change event to fire with 'remove' passed as the how parameter and undefined passed as the newVal to handlers. It will also cause a property name event to fire with undefined passed as newVal. An in-depth description at these events can be found under attr.