Skip to content

Instantly share code, notes, and snippets.

@msrivastav13
Created February 29, 2016 02:39
Show Gist options
  • Save msrivastav13/69014c360ac5fff683a3 to your computer and use it in GitHub Desktop.
Save msrivastav13/69014c360ac5fff683a3 to your computer and use it in GitHub Desktop.
<apex:page showHeader="false" sidebar="false">
<apex:includeLightning />
<div id="lightning"> Hello world VF ..!!! </div>
<script>
$Lightning.use("c:myEventApp", function() {
$Lightning.createComponent("c:myComponent", {}, "lightning", function(){
$A.eventService.addHandler({ "event": "c:myEvent", "handler" : visualForceFunction});
});
});
</script>
<script>
var visualForceFunction = function(event){
var myEventData = event.getParam("data");
console.log(myEventData);
};
</script>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment