Skip to content

Instantly share code, notes, and snippets.

@arun12209
Last active April 12, 2020 07:52
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 arun12209/2473c821e87a9e2dbbe22950fe3644ff to your computer and use it in GitHub Desktop.
Save arun12209/2473c821e87a9e2dbbe22950fe3644ff to your computer and use it in GitHub Desktop.
NewsApp
<apex:page showHeader="false" sidebar="false">
<apex:includeLightning />
<div id="LightningCompDisplayId"></div>
<script>
//please note that you need to create a lightning application and need to put the main component uder this app.
/* <aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
<aura:dependency resource="c:News"/>
<c:News />
</aura:application>
*/
//This Lightning app 'NewsApp' will be used here.
$Lightning.use("c:NewsApp", function() {
/* 'News' is Lightning Component Name which we are Displaying In Vf Page
* syntax for create lightning component dynamically :
* $Lightning.createComponent(String type, Object attributes, String locator, function callback) */
$Lightning.createComponent("c:News",
{
},
"LightningCompDisplayId",
function(component) {
// create component Callback, Lightning Component has been Created,
// Now you can set more lightning Component attributes here,
});
});
</script>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment