Last active
April 12, 2020 07:52
-
-
Save arun12209/2473c821e87a9e2dbbe22950fe3644ff to your computer and use it in GitHub Desktop.
NewsApp
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="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