Last active
March 29, 2019 02:54
-
-
Save sfcure/c276ac1bed8e988bee4d8397ee337653 to your computer and use it in GitHub Desktop.
Using Lightning Component in a Visualforce page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:application access="global" extends="ltng:outApp" > | |
<c:SampleComp /> | |
</aura:application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component access="global" > | |
<h1>Sample Lightnign Component for a Visualforce Page Demo </h1> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="false" sidebar="false"> | |
<apex:includeLightning /> | |
<div id="componentContainerId" /> | |
<script> | |
$Lightning.use("c:SampleApp", function() { | |
$Lightning.createComponent("c:SampleComp", | |
{ | |
}, | |
"componentContainerId", | |
function(cmp) { | |
console.log('Rendering the lightning component.'); | |
}); | |
}); | |
</script> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment