Created
October 9, 2016 15:39
-
-
Save kiran-machhewar/2fb290c1758e84dcb52f29e5f0a12ba3 to your computer and use it in GitHub Desktop.
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
({ | |
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