Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulmalhotra/3a467f45937aa7106bcf000ecaf16bb2 to your computer and use it in GitHub Desktop.
Save rahulmalhotra/3a467f45937aa7106bcf000ecaf16bb2 to your computer and use it in GitHub Desktop.
Controller file in container component used in Lightning Events Tutorial Part 3 by SFDC Stop - added event.stopPropagation();
({
// Function to handle Lightning Event
handleTotalIncomeComponentEvent : function(component, event, helper) {
alert('Event handler at the parent component');
// Getting the value of totalIncome attribute of event using event.getParam()
var totalIncome = event.getParam('totalIncome');
// Setting the totalIncome attribute of component with the event's totalIncome attribute value.
component.set('v.totalIncome', totalIncome);
event.stopPropagation();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment