In practice, a Lightning component’s code cannot directly interact with its parent and vice versa. A parent component cannot manipulate its children or siblings as with standard JavaScript and the DOM. Inter-component communication must be specified by the developer.
Below are the 3 possibilities of communication between components:
Option 1: Attributes
Option 2 : aura:methods
<!-- parent.cmp--> <aura:component> <c:child name="hello"/> </aura:component>
Option 3 : Applicaton Event
Possibility 2: Communicating From Child component to parent:
Option 1: Application Events
Option 2: Component events
Possibility 3: Communication between 2 independent components:
Option 1: Application Events [ provided that they have registered the appropriate event handler.]
To understand the real use cases of the above, it is mandatory to refer to this blog post: ClickHere
Comments
Post a Comment