1. What are the type of events into Salesforce Lightning component?<\/strong><\/p>\n a. Application Event<\/strong> \u2013 Scope of this event is throughout the lightning App and any component which has registered for this event would get a notification. 2. What are the basic differences between Application Event and Component Event?<\/strong><\/p>\n Component events are used to do communication between child and parent. They use bubbling and capture same as used in DOM events. A change in a child component can be communicated to the parent component via component event.<\/p>\n Application events are used to communicate any change in the component to a broader audience. Any component who has registered for this event will get a notified. 3. When should we use Component event and application events?<\/strong><\/p>\n It is best to always use a component event instead of an application event. Component events can only be handled by components above them in the containment hierarchy, therefore, their usage is localized to the components that need to know about them.<\/p>\n Application events are best used for something that should be handled at the application level, such as navigating to a specific record. Application events allow communication between components that are in separate parts of the application and have no direct containment relationship.<\/p>\n 4. Which interface we are supposed to implement so that a lightning component can be used as quick action?<\/strong><\/p>\n We need to implement the following \u201cforce: lightningQuickAction\u201d so that we can use the component as a Quick Action<\/p>\n 5. Which interface we are supposed to implement so that a lightning component can be used as a Tab?<\/strong><\/p>\n We need to implement the following \u201cforce:appHostable\u201d so that we can use the component as a Tab<\/p>\n 6. How can we use a lightning component in a VisaulForce Page? Explain?<\/strong><\/p>\n A Lightning component can be embed in any webpage using a very powerful and flexible feature, Lighting out. When used with Visualforce some complexity becomes simpler. 1. We have to first Add the Lightning Components for Visualforce JavaScript library to your targetted Visualforce page using the tag.<\/p>\n 2. Next we have to create and refer a Lightning app which is used to the component dependencies.<\/p>\n 3. Lastly we need to write a JavaScript function which will finally create the the component on the page using $Lightning.createComponent()<\/p>\n 7. How can we call child component controller method from the parent component controller method?<\/strong><\/p>\n To call a child component\u2019s controller method, we need to first create a aura:method which is publically accessible, aura:method is used to communicate down the containment hierarchy i.e. parent to child. Sample code for implementing the aura method: Controller Calling the cild method from parent controller 8. What are the different Lightning component bundles?<\/strong> 9. How to ensure FLS while working with Lightning Component?<\/strong><\/p>\n FLS and CRUD are not automatically enforced in the lightning component whenever any object is referenced in the Apex Controller and the component will display the fields and records for which the users do not have access. Therefore we should manually enforce the FLS and CRUD in the Apex Controller, or we should try to use Lightning Data service wherever possible because it takes care of FLS and CRUD for us.<\/p>\n 10. How can we use Lightning Components with the Salesforce1 Mobile App ?<\/strong><\/p>\n For this purpose we need to first make a lightning tab which points to the lightning component we created and then we have to include that tab in the salesforc1 Mobile Navigation select list and the newly created tab to it.<\/p>\n 11. Can we make a Lightning Component that shows up in both the mobile and the desktop user interfaces?<\/strong><\/p>\n Lightning component is lightning experience ready by default and is also compatible in Salesforce1 App, it has a responsive layout therefore it adjust its resolution according the screen size and therefore can be used on desktop as well without writing any separate code.<\/p>\n 12. Is Lightning component framework an MVC framework ?<\/strong><\/p>\n No it is not a MVC framework it is a component based framework and event driven.<\/p>\n 13. Which parts of Lightning Components are server-side and which are client-side ?<\/strong><\/p>\n Lightning components have two types of controller, one which uses javascript and responds to the event occurring in the components at client side and the second controller which is an apex class. Method of apex controller are accessed by the JavaScript controller methods asynchronously.<\/p>\n 14. Can we make one component inherit styles\/CSS from a parent component, or must we always define it in the component ?<\/strong><\/p>\n Child component inherits the CSS from its aren\u2019t we do not need to specify it for each component<\/p>\n 15. What is the use of the aura:method tag in Lightning ?<\/strong><\/p>\n aura:method is used to communicate down the containment hierarchy i.e. parent to child<\/p>\n 16. Can we Include One Lightning component to another ?<\/strong><\/p>\n Yes we can include one Lightning component in another Lightning component<\/p>\n 17. Is there any limit on how many component to have in one Application?<\/strong><\/p>\n There is no limit on number of components defined within an application by salesforce<\/p>\n 18. Is Lightning Components replacing Visualforce?<\/strong><\/p>\n No Lightning component is not replacing Visualforce, Visualforce is still supported by Salesforce.<\/p>\n 19. What is Aura? Why do we use the aura: namespace in the code?<\/strong><\/p>\n Aura is a UI framework for developing dynamic web apps for mobile and desktop devices. Aura provides a scalable long-lived lifecycle to support building apps engineered for growth.<\/p>\n Aura supports partitioned multi-tier component development that bridges the client and server. It uses JavaScript on the client side and Java on the server side.<\/p>\n 20. Do we need a namespace to develop Lightning Components?<\/strong><\/p>\n You can have namespace in your org but it is not necessary to have a namespace to develop lightning component.<\/p>\n 21. What are the tools included in lightning?<\/strong><\/p>\n Lightning App Builder \u2013 It is a tool with User interface to use drag and drop functionality and create app fast by reusing the components, components can be standard or custom depending upon your requirement. 22. What is difference between Visualforce Components and Lightning Components?<\/strong><\/p>\n Visualforce page is created keeping page as the center of the application and most of its calculation is performed at the server side. Lightning component on the other hand are created using the component based framework, most of the calculations are performed at the client side and makes the more dynamic and provide rich customer experience, also lightning component are build using mobile first approach.<\/p>\n 23. Does Lightning work with Visualforce ?<\/strong><\/p>\n Yes Lightning component works with Visualforce by implementing Lightning out as discussed earlier.<\/p>\n 24. Are there any CSS (styles) provided by salesforce.com as part of the supported Lightning Components ?<\/strong><\/p>\n Salesforce has provided lightning design system as the default css to be used with Lightning component.<\/p>\n 25. Are Lightning Components intended only for mobile apps?<\/strong><\/p>\n Although lightning framework creates component keeping mobile first approach, but its responsive design helps in providing the same experience over the desktop without writing separate lines of code<\/p>\n 26. What are the advantages of lightning?<\/strong><\/p>\n There are many advantages of using lightning like its out of the box component set which enables the fast paced creation of new apps, its event driven architecture which enables the easy decoupling between the components. Device awareness, cross browser compatibility and framework optimized for the performance.<\/p>\n 27. Can we integrate Lightning components with another framework, such as Angular?<\/strong><\/p>\n Yes we can integrate lightning with any 3rd party framework.<\/p>\n 28. Can we include external JavaScript\/CSS libraries in components?<\/strong><\/p>\n It is possible to use custom CSS and JAvascriipt in the Lightning component<\/p>\n 29. What happens with existing Visualforce Pages in Lightning Experience?<\/strong><\/p>\n Most of the Visualforce page can be easily converted to lightning experience, but they are still supported by the salesforce and are not required to be converted<\/p>\n 30. Where we can display lightning component?<\/strong><\/p>\n Lightning component can be displayed at following places: 31. Do I always create an app bundle first when develop lightning component ?<\/strong><\/p>\n No it is not necessary to create an Appp Bundle first to develop the lightning component<\/p>\n 32. How can we deploy components to production org?<\/strong><\/p>\n Lightning component can be deployed to the production via change sets, force.com IDE, Managed Package.<\/p>\n 33. What is Lightning Experience?<\/strong><\/p>\n It is the new user Interface developed by salesforce team, which is built on component based framework and event driven architecture, which provides a dynamic and responsive Experience to the user. This framework is built to provide optimum performance by using stateful Client side and stateless Server architecture<\/p>\n 34. What is the use of implements in lightning component?<\/strong><\/p>\n Implements is use to refer platform interfaces which enables a component to be used in different contexts or to grant access to extra context data, a component can implement more than one interfaces.<\/p>\n 35. What is aura:registerevent in lightning component?<\/strong><\/p>\n aura:registerevent is the notifier component and it declares that it may fire a particular event, it includes \u2018name\u2019 attribute which is relevant only to component event and is not used for application event. Other attribute is the \u2018type\u2019 which lets the component know which event would be fired.<\/p>\n Ex. <\/strong><aura:registerEvent name=”Event” type=”c:EventName”\/><\/p>\n 36. How can we subscribe to an event in lightning component?<\/strong><\/p>\n To subscribe to an event in lightning component we need to include tag in the containment hierarchy. Subscription of these event depends on the event type i.e. component event or application event. For Component event we write below code.<\/p>\n In this \u2018name\u2019 attribute in should be exactly as name attribute in tag in the component which has fired the component. The \u2018action\u2019 attribute of sets the client-side controller action to handle the event. The \u2018event\u2019 attribute specifies the event being handled. \u2018Event\u2019 and \u2018action\u2019 attribute are same as the component event handling, it is just that we do not include \u2018name\u2019 attribute to handle the application event.<\/p>\n 37. How can we communicate between two component?<\/strong><\/p>\n In Lightning Component Framework, the communication between two component is accompalished supported in several ways. 38. What is aura definition bundle?<\/strong><\/p>\n It represents a Lightning definition bundle, it contains a Lightning definition and all its related resources. It could define a component, application, event, interface, or a tokens collection.<\/p>\n An AuraDefinitionBundle component is a collection of component definition files, each representing a different resource such as markup code, event documentations, applications and interfaces.<\/p>\n Lightning bundles must be under a top-level folder that\u2019s named aura. Each bundle must have its own subfolder under the aura folder.<\/p>\n A bundle doesn\u2019t have a suffix but definition files can have one of these suffixes
\nb. Component Event<\/strong>– Scope of this event is within itself or the parent component of this event, all the components declared within the parent component would get notified of this event.
\nc. System Event- these are the events fired by Salesforce\u2019s system during the lifecycle of the lightning app.<\/p>\n
\nTo use Component Event API we use the below syntax<\/p>\n
\nLightning component can be added to Visualforce page in three steps:<\/p>\n
\nComponent code<\/p>\n
\n({
\npublicmethod: function(cmp, event) {
\nvar params = event.getParam(‘arguments’);
\nif (params) {
\nvar message = params. str;
\nconsole.log(“message: ” + message);
\nreturn message;
\n}
\n}
\n})<\/p>\n
\n({
\ncallchildCompMethod : function(component, event, helper) {
\nvar childCmp = component.find(“childCompName”);
\nvar Result =
\nchildCmp. publicmethod (“message sent by parent component”);
\nconsole.log(“Result: ” + Result);
\n}
\n})<\/p>\n
\na. Component
\nb. Controller
\nc. Helper
\nd. Style
\ne. Document
\nf. Design
\ng. SVG
\nh. Rendrer<\/p>\n
\nLightning Component Framework- it provides a bundle that can be used to build reusable custom components, Standalone App and to customize Salesforce1 App
\nLightning Connect – it is a powerful tool to facilitate the integration of force.com app with an external data source using OData specification
\nLightning Process Builder \u2013 it is a visualization tool to build automation required for your business processes.
\nLightning Schema Builder \u2013 it is a visualizing tool to view, create objects fields and relationship among them.<\/p>\n
\n1. Lightning Experience
\n2. Salesforce1 App
\n3. Template-based Community
\n4. Standalone Lightning App
\n5. Visualforce Pages (Using Lightning out )<\/p>\n
\nFor Handling Application event we write below code<\/p>\n
\n1. Attributes or Methods to pass data down the component hierarchy
\n2. Lightning Events to pass data up and around in the component hierarchy<\/p>\n
\nSuffix Component Type<\/p>\n