Requirement: Embed Salesforce Lightining component In Visualforce Page.
Lightning Components is a UI framework for developing web apps for mobile and desktop devices. It’s a modern framework for building single-page applications with dynamic, responsive user interfaces for Lightning Platform apps. It uses JavaScript on the client side and Apex on the server side.
Ok’s Alot of talking now move to the code.
Steps to be followed for Embed Salesforce Lightining component In Visualforce Page are:
1) create Lightining application
2) Then create a Lightining Component
3) Now embed your lightining component in Visualforce page in which you want to show your lightining component
To Embed your lightining component in visualforce page follow the below code
<apex:page standardController="Services__c" sidebar="false"> <apex:includeLightning /> // div in which we embeed our lightining component <div id="LcDisplayId" /> <script> $Lightning.use("c:yourlightiningApplicationname",function() { $Lightning.createComponent("c:Yourcomponentname",{ // here you can pass parameter to your component 'recordId':'{!Services__c.id}' }, "LcDisplayId", // call back function function(cmp) { } ); }); </script> </apex:page>
Hits: 323