▷ Top 50 Salesforce Lightning Interview Questions & Answers 2022

TOP 20 Salesforce Lightning Interview Questions and Answers 2019 | Salesforce Lightning | Wisdomjobs

3. How can we develop these components/what tools must we use?

Aura components can be developed directly in Salesforce using the developer console, although third party IDEs (such as VSCode using SFDX) greatly improve developer efficiency.

LWCs can only be developed using third party tools, which Salesforce recommends VSCode and their extension pack.

9. How can we make our components admin configurable?

Both Aura components and LWCs can expose component properties into the Lightning App Builder and Experience builder screens for further customisation by admins as they see fit. We can also further limit where our components appear, preventing record-based components from appearing on the incorrect object pages.

For Aura components we have a design resource file, which is where we define these. We do so by specifying a “design:attribute” for each “aura:attribute” we wish to be customised. We can also use “sfdc:objects” to limit the objects which the component can be used on.

For LWC, we define our customisable properties from within the “.js-meta.xml” file which is found inside all LWC component folders. We do this by defining “property” tags within “targetConfigs” tags. LWC offers us far more flexibility than Aura does, allowing us to define individual properties to be exposed based on the target context (i.e. record page vs app builder page). Also, as within Aura, we can define which objects the component should be limited to using “objects” tag.

8. How can we express data into our HTML markup?

If we wish to express data within our HTML markup we need to use bind expressions. The syntax differs between LWC, as do the capabilities.

In Aura we use can use one of two syntaxes, “{!v.value}” and “{#v.value}”. The first enables two way data-binding (i.e. if you update it in one location, the other is also updated) and the second is for one way binding.

In LWC, we have a single syntax to follow, simply by using “{value}”.

Alongside simply displaying pieces of data, we can also use conditionals and iterations to manipulate the final markup. For simple “if” logic we can use “aura:if” in Aura and “if:true”/“if:false” in LWC. For displaying arrays, we can use “aura:iteration” in Aura or “for:each” in LWC, both of which work similarly by taking a piece of markup contained within them and repeating it once for each item in the array.

26. Where can we use the lightning components?

In the following places, we can use lightning components:

  • Drag-and-drop components in the community builder and lightning app builder.
  • Add lightning components to the lightning pages.
  • Start the lightning component like a quick action.
  • Create stand-alone applications.
  • Any component can dismiss and handle the application events. Application events do not need any type of relationship among the components, and these components should be a part of one application.

    4. How do the two programming models coexist?

    Aura components can contain and utilise LWCs, including communicating with them via events and component methods. However, the opposite is not true, an LWC cannot be composed of Aura components, and they can only ever be its parent.

    Code can also be shared between Aura and LWC components using an ES Module.

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *