Lightning Component Bundle

A Lightning Component bundle consists of four primary sections (there are also Renderer, Design, and SVG sections apart from these four, which we will cover in upcoming chapters):

  • Lightning Component Markup file (.cmp) file: This is an XML component definition and consists of HTML markup.
  • CSS file (.css): This consists of CSS for the component.
  • JavaScript helper and controller (.js): This consists of JavaScript code. The helper file is used to keep all the reusable code for the component. 
  • Apex controller (.cls): This is not a part of the bundle, but every component that uses Salesforce data uses a server-side controller to fetch and post data to the Salesforce servers.

In the last section of this chapter, we ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.