Skip to content

Instantly share code, notes, and snippets.

@sfcure
Last active March 29, 2019 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfcure/c276ac1bed8e988bee4d8397ee337653 to your computer and use it in GitHub Desktop.
Save sfcure/c276ac1bed8e988bee4d8397ee337653 to your computer and use it in GitHub Desktop.
Using Lightning Component in a Visualforce page
<aura:application access="global" extends="ltng:outApp" >
<c:SampleComp />
</aura:application>
<aura:component access="global" >
<h1>Sample Lightnign Component for a Visualforce Page Demo </h1>
</aura:component>
<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