Contents
What are the principal ways to interact with or affect other components?
There are two principal ways to interact with or affect another component. The first way is one we’ve seen and done quite a bit of already: setting attributes on the component’s tag. A component’s public attributes constitute one part of its API. The second way to interact with a component is through events.
What is the difference between element and component?
There is certainly a difference between elements and components. Furthermore, a component refers to a small part of a larger entity that mostly is a manufactured object. In contrast, an element is one the simplest parts of which anything consists of.
How does fire event work in Lightning aura?
Fire a component event to communicate data to another component. A component event can be handled by the component that fired the event or by a component in the containment hierarchy that receives the event.
How are events fired in the Lightning component?
In the Lightning Component Framework, events are fired by the JavaScript controller actions. Events can contain attributes that can be set before the event is fired and read when the event is handled. Events are declared by the aura:event tag, and they can have one of two types: A component event is fired from an instance of a component.
How to create two Lightning components in Salesforce?
Create two lightning components: Child component and parent component. Register the event in the child component and fired the event in the child component JavaScript controller action. Handle the event in the parent component.
How are framework events triggered in Lightning framework?
In Lightning, framework events are triggered by client-side JavaScript controller actions. The attributes in an event could be set before the event gets triggered and read-only when the event is handled.