Skip to content

Instantly share code, notes, and snippets.

@mtetlow
Last active July 12, 2018 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtetlow/4bd5bb17625975ef316b02a8a42731d0 to your computer and use it in GitHub Desktop.
Save mtetlow/4bd5bb17625975ef316b02a8a42731d0 to your computer and use it in GitHub Desktop.
Using a TaskRay Lightning Component in Aloha
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="TASKRAY_LTNG:trProjectStatusBar"/>
</aura:application>
<apex:page docType="html-5.0" standardStylesheets="false" showHeader="false" sidebar="false" standardController="Opportunity">
<!-- Concept is:
1) A VF page with a standard controller of Opportunity will allow the vf page to be dropped onto the Opp page layout
2) Get the context/opportunity record id to feed to the lightning component, use a controller extension to do this
3) Create a lightning App to pull in the appropriate dependencies
4) Use lightning out to pull in the app and the appropriate dependency
-->
<apex:includeLightning />
<div id="lightning" />
<script>
var oppId="{!JSENCODE(Opportunity.Id)}";
$Lightning.use("c:OpportunityDependencies", function() {
$Lightning.createComponent("TASKRAY_LTNG:trProjectStatusBar",
{ recordId : oppId },
"lightning",
function(cmp) {
// do some stuff
});
});
</script>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment