The Lightning Part framework could also be a UI framework for growing net apps for cell and desktop units. It’s a recent framework for constructing single-page functions with dynamic, responsive consumer interfaces for Lightning Platform apps. It makes use of JavaScript on the consumer aspect and Apex on the server aspect.
“The Lightning Part framework is a framework for growing net apps.”
Creating and Enhancing Aura Elements
- Choose File | New | Lightning Part to create an Aura element.
- Within the New Lightning Bundle panel, enter helloWorld for the element title.
- Click on Submit
Your element markup ought to seem like the next:
What’s a Part?
A element is a bundle that features a definition useful resource, written in markup, and will embody extra, optionally available sources like a controller, stylesheet, and so forth.
A useful resource is type of like a file however saved in Salesforce somewhat than on a file system.
There are the opening and shutting <aura:element> tags, with some static HTML in between.
A bundle is type of like a folder. It teams the associated sources right into a single element. Sources in a bundle are auto-wired collectively by way of a naming scheme for every useful resource sort. Auto-wiring simply signifies that a element definition can reference its controller, helper, and so on., and people sources can reference the element definition. They’re attached to one another (largely) routinely.
Remember to take a look at: Use Aura Component in Screen Flow | Salesforce Flow Builder Tutorial
What’s an App?
- An app makes use of <aura:utility> tags as an alternative of <aura:element> tags.
- Solely an app has a Preview button within the Developer Console.
What Are Apps For?
- When writing markup, you may add a element to an app, however you can’t add an app to a different app, or an app to a element.
- An app has a standalone URL that you would be able to entry whereas testing, and which you’ll publish to your customers. We frequently refer to those standalone apps as “my.app.”
- You’ll be able to’t add apps to Lightning Expertise or the Salesforce app—you may solely add parts. After the final unit this would possibly sound bizarre; what precisely do you add to the App Launcher, if not an app? What you add to App Launcher is a Salesforce app, which wraps up an Aura element, one thing outlined in a <aura:element>. An Aura parts app—that’s, one thing outlined in a <aura:utility> —can’t be used to create Salesforce apps. A bit bizarre, however there it’s.
Part Attributes
Attributes on parts are like occasion variables in objects. They’re a solution to save values that change, and a solution to title these worth placeholders.
For instance, let’s say we wished to write down a helloMessage element that prints a customized message. We will envision including a message attribute to this element to customise its output.
Instance:
<aura:element> <aura:attribute title="message" sort="String"/> <p>Hey! [ message goes here, soon ]</p> </aura:element>
Try one other superb weblog right here: Overview of Aura Components in Salesforce | The Developer Guide
Expressions
An expression is mainly a method, or a calculation, which you place inside expression delimiters (“ {!” and “ }”).
{!<expression>}
An expression is any set of literal values, variables, sub-expressions, or operators that may be resolved to a single worth.
<aura:element> <aura:attribute title="message" sort="String"/> <p>{!'Hey! ' + v.message}</p> </aura:element>