Component
Component contains methods to work with components.
-
Dynamically adds an event handler for a component or application event.
-
Deprecated. Use
addEventHandler()instead. -
Adds handlers to values owned by the component.
-
Adds custom value providers to a component.
-
Sets a flag to tell the rendering service whether or not to destroy this component when it is removed from its rendering facet.
-
Clears a live reference for the value passed in using property syntax. For example, if you use
aura:setto set a value and later want to reset the value usingcomponent.set(), clear the reference before resetting the value. -
Destroys the component and cleans up memory. After a component that is declared in markup is no longer in use, the framework automatically destroys it and frees up its memory. If you create a component dynamically in JavaScript and that component isn’t added to a facet (
v.bodyor another attribute of typeAura.Component[]), you have to destroy it manually usingdestroy()to avoid memory leaks. -
Locates a component using its local ID (
aura:id). -
Returns the value referenced using property syntax. For example,
cmp.get("v.attr")returns the value of theattrattribute. -
Gets the concrete implementation of a component. If the component is concrete, the method returns the component itself. For example, call this method to get the concrete component of a super component.
-
If the component renders only a single element, return it. Otherwise, use
getElements(). -
Returns a map of the elements rendered by the component.
-
Returns a new event instance of the named component event.
-
Gets the global ID, which is the generated globally unique id of the component. It can be used to locate the instance later, but will change across page loads.
-
Gets the ID set using the
aura:idattribute. Pass the local ID intofind()on the parent component to locate this child component. -
Returns the component’s code-compatible camel case name, such as
'lightningButton'. -
Returns a live reference to the value indicated using property syntax. This method is useful when you dynamically create a component.
-
Returns the super component.
-
Returns the component’s canonical type; for example,
'lightning:button'. -
Returns the component’s version number.
-
Returns
trueif the component is concrete, orfalseotherwise. A concrete component is a sub-component in an inheritance chain. -
Checks whether a component is an instance of the given component or interface name.
-
Returns
trueif the component has not been destroyed. -
Dynamically removes a component event handler for the specified event.
-
Sets the value referenced using property syntax.