Professional Documents
Culture Documents
Aura Component in Lighting-Notes
Aura Component in Lighting-Notes
Aura Component in Lighting-Notes
Aura components are the self-contained and reusable units of an app. They represent a reusable section
of the UI, and can range in granularity from a single line of text to an entire app. Event-driven
programming is used in many languages and frameworks, such as JavaScript and Java Swing.
Aura is an open-source UI framework built by Salesforce for developing dynamic web apps for mobile
and desktop devices. The lightning component framework is not different from the Aura framework
rather it is a subset of the Aura framework. The Lightning Component framework is built on the
open-source Aura framework.
Salesforce Lightning Component is a user interface (UI) based framework for developing single-page
mobile/desktop/web-based applications. Using the Lightning Component along with these tools, you can
customize and deploy new apps in mobile devices easily and effortlessly. Aura components are reusable
units of the app
1. Aura-based Lightning components are built using both HTML and JavaScript, but LWC is built
directly on the Web stack.
2. Web components can easily interact with the Aura component and can handle the events of one
another
3. A developer who works on LWC is not only using coding skills on a particular framework but in
other frameworks like React or Angular, which are based on the Web Stack.
4. In addition to the latest features, LWC still embraces the features like the Security, Lightning Data
Service, and Base lightning components from Aura.
5. Creating an LWC is fast as it no longer requires the user to download the JavaScript and wait for
the engine to compile it before rendering the component.
6. It is possible to include LWC in Aura, but not the other way around as the generic elements
cannot be added to the custom components.
Component– A markup language is used for configuring the layout of the component.
Design File– A design file is used for describing the design-time behavior of the component being
used in Lightning pages or in Lightning App Builder.
SVG File– An SVG File enables you to include custom icons that can be used for reference
further.
Interfaces determine a component’s shape by defining its attributes. Implement an interface to allow a
component to be used in different contexts, such as on a record page or in Lightning App Builder.
ex: flexipage:availableForRecordHome,force:hasRecordId
Module 4- Attributes
This is nothing but a kind of variable in the lighting component which we use to flow the data. It has two
mandatory parameters Name and type. Access denotes the access of variables.
Events:
An event is an action that is performed by the user, while interacting with an app. Based on that event a
developer can decide to perform some manipulation in his code. The events may or may not be triggered
by user interaction.
The framework uses event-driven programming. You write handlers that responds to the interface events
as they occur.
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
A component event is fired from an instance of a 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.