PDI · Question #162
Which three resources in an Azure Component can contain JavaScript functions?
The correct answer is A. Controllers B. helper E. Renderer. In Aura components, JavaScript functions are primarily implemented within the Controller, Helper, and Renderer resources.
Question
Which three resources in an Azure Component can contain JavaScript functions?
Options
- AControllers
- Bhelper
- CDesign
- DStyle
- ERenderer
How the community answered
(25 responses)- A88% (22)
- C4% (1)
- D8% (2)
Why each option
In Aura components, JavaScript functions are primarily implemented within the Controller, Helper, and Renderer resources.
The Controller (`.js` file) defines functions to handle user interactions and component lifecycle events, acting as the primary interface for client-side logic.
The Helper (`Helper.js` file) contains reusable JavaScript functions that can be called by the Controller, promoting modularity and separation of concerns.
The Design resource (`.design` file) is an XML file for defining component attributes for customization in tools like App Builder; it does not contain JavaScript functions.
The Style resource (`.css` file) is used for defining component styles and appearance; it does not contain JavaScript functions.
The Renderer (`Renderer.js` file) contains JavaScript functions that override or extend the default rendering behavior of a component, executing at various stages of the component's rendering lifecycle.
Concept tested: Aura component JavaScript resource types.
Source: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_javascript_resources.htm
Topics
Community Discussion
No community discussion yet for this question.