Skip to content

Instantly share code, notes, and snippets.

@kiran-machhewar
Created October 9, 2016 15:39
Show Gist options
  • Save kiran-machhewar/2fb290c1758e84dcb52f29e5f0a12ba3 to your computer and use it in GitHub Desktop.
Save kiran-machhewar/2fb290c1758e84dcb52f29e5f0a12ba3 to your computer and use it in GitHub Desktop.
({
initialize : function(component, event, helper) {
var action = component.get("c.getContacts");
var self = this;
action.setCallback(this, function(a) {
var contacts = a.getReturnValue();
component.set("v.contacts", contacts);
console.log('Contacts are loaded.');
});
$A.enqueueAction(action);
},
callExternalFunction : function(component, event, helper){
console.log('Inside lightning controller function-->callExternalFunction');
var lightningAppExternalEvent = $A.get("e.c:lightningAppExternalEvent");
lightningAppExternalEvent.setParams({'data':component.get('v.contacts')});
lightningAppExternalEvent.fire();
},
lightningAppEventHandler : function(component, event, helper){
console.log('Inside lightning controller function-->lightningAppEventHandler');
console.log('Value of TestDataKey',event.getParam('data').TestDataKey);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment