Getting started with basics of Lightning Component

We will be discussing about  basics of Lightning components in this post and how Lightning application, component, controller, helpers and Apex controllers are connected with each other.

Lightning components is a UI framework for developing web apps for mobile and desktop device. it is modern framework for building single-page application with dynamic, responsive user interface for lightning platform apps. it uses java script on client side and apex on the server side.

In below image, I am going to show the connectivity of Lightning application, component, controller, helpers and Apex controllers.

Lightning Application

Lightning applications are standalone page, which contains many other lightning components. Its mark up is similar to HTML as shown in above image.

Lightning Component

It can contain “HTML + Aura components” supported by Salesforce.

As shown in above image, Lightning component consists of Controller ( JS ), Helper ( JS ), Style ( CSS ), Documentation, Rerenderer, design and SVG. We will be using only Controller and Helper in this post.

JavaScript Controller

We can click on “Controller” link available on right of component (above image). Client-side controller methods to handle events in the component.

JavaScript Helper

click on “Helper” link available on right of component (above image). It will also create new JavaScript file which will be used by Component. This file mostly interacts with Apex method defined in @AuraEnabled static public method.

Leave a Reply

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