* If `attr` is a component name, detach the component from the entity. * * If `propertyName` is given, reset the component property value to its default. * * @param {string} attr - Attribute name, which could also be a component name. * @param {string} propertyName - Component prop na
(attr, propertyName)
| 467 | * @param {string} propertyName - Component prop name, if resetting an individual prop. |
| 468 | */ |
| 469 | removeAttribute (attr, propertyName) { |
| 470 | var component = this.components[attr]; |
| 471 | |
| 472 | // Remove component. |
| 473 | if (component && propertyName === undefined) { |
| 474 | this.removeComponent(attr, true); |
| 475 | } |
| 476 | |
| 477 | // Reset component property value. |
| 478 | if (component && propertyName !== undefined) { |
| 479 | component.resetProperty(propertyName); |
| 480 | return; |
| 481 | } |
| 482 | |
| 483 | // Remove mixins. |
| 484 | if (attr === 'mixin') { |
| 485 | this.mixinUpdate(''); |
| 486 | } |
| 487 | |
| 488 | window.HTMLElement.prototype.removeAttribute.call(this, attr); |
| 489 | } |
| 490 | |
| 491 | /** |
| 492 | * Start dynamic behavior associated with entity such as dynamic components and animations. |