MCPcopy
hub / github.com/aframevr/aframe / removeAttribute

Method removeAttribute

src/core/a-entity.js:469–489  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 15

raycaster.jsFile · 0.80
fixVideoAttributesFunction · 0.80
light.test.jsFile · 0.80
material.test.jsFile · 0.80
raycaster.test.jsFile · 0.80
animation.test.jsFile · 0.80
shadow.test.jsFile · 0.80
geometry.test.jsFile · 0.80
cursor.test.jsFile · 0.80
gltf-model.test.jsFile · 0.80
obj-model.test.jsFile · 0.80
background.test.jsFile · 0.80

Calls 2

removeComponentMethod · 0.95
mixinUpdateMethod · 0.95

Tested by 1

onEyeLoadedFunction · 0.64