Last active
July 12, 2018 21:05
-
-
Save mtetlow/4bd5bb17625975ef316b02a8a42731d0 to your computer and use it in GitHub Desktop.
Using a TaskRay Lightning Component in Aloha
This file contains hidden or 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"> | |
<aura:dependency resource="TASKRAY_LTNG:trProjectStatusBar"/> | |
</aura:application> |
This file contains hidden or 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 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