Newer Version Available
Events
The framework uses event-driven programming. You write handlers that respond to interface events as they occur. The events may or may not have been triggered by user interaction.
In the Lightning Component framework, events are fired from 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 in a .evt resource, and they can have one of two types: component or application.
- Component Events
- A component event can be handled by a component itself or by a component that instantiates or contains the component.
- Application Events
- Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component. All components that provide a handler for the event are notified.