Events are used to Communicate between components. I'm unable to understand why I have to use events when I can pass parameters between components as attributes?
1 Answer
When two components can "see" each other, you can pass an attribute as you mention or call a method:
Use
<aura:method>
to define a method as part of a component's API. This enables you to directly call a method in a component’s client-side controller instead of firing and handling a component event. Using simplifies the code needed for a parent component to call a method on a child component that it contains.
Events are good for loose coupling. When two components can't see each other, then events are better than doing a search by some kind of ID and then using an attribute or a method.