I like to compose functions from smaller blocks.

helperA : function (component, param){
  //do stuff

helperB : function (component, params){
  //do stuff, and
  helperA(component, params)

That doesn't work. Also tried

  • sticking this. in front of it
  • passing the function helperA in as a param to helperB so that it's defined.

How do I call a function from another, either in the controller or the helper?


1 Answer 1


You can definitely call another function within the same object using the this keyword. I just tested the following code and it works. The example doesn't make sense but it demonstrates the functionality of the code:


<aura:component >
    <input type="button" onclick="{!c.buttonClicked}" value="Click Me" id="myButton" />


    buttonClicked : function(component, event, helper) {
        helper.changeMyLabel(component, event.target.id);


    changeMyLabel : function(component, buttonId) 
        var newLabel = 'My Label Changed';
        this.changeButtonLabel(component, buttonId, newLabel);  
    changeButtonLabel : function(component, buttonId, newLabel)
        document.getElementById(buttonId).value = newLabel;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .