I'm trying to get the label of the button the user has clicked on by using event.getSource, but I'm getting the error that event.getSource is not a function.
Component
<lightning:button variant="brand" label="Submit" onclick="{!c.save}" />
Controller
save: function(component, event, helper){
var target = event.getSource();
console.log(target.get("v.label"));
}
Error
Uncaught Action failed: c$TimeTrackingTab$controller$save [event.getSource is not a function]
I found this function documented by Salesforce here.
Any ideas?
LockerService
enabled?