3

How can i call JS(client side controller) function into helper js function. Please show me the code. Thankyou

3

Danryl,

A Sample Code below.

<aura:component >
    <ui:outputText aura:Id="Hello" value=""/>
    <ui:button label="Click" press="{!c.Click}"/>
</aura:component>

//Controller

({
    Click : function(component, event, helper)
    {

        helper.helperMethod(component,event,sum);
    }
})

//Helper

({
    helperMethod : function(component,sum) 
    {
        var hello=component.find("Hello");
        hello.set("v.value","New Value !!!")

    }
})

As ankuli suggested, refer the trailhead document.

2
0

you can call helper js method from client side controller but reverse is not defined anywhere. helper.callMethodOfClinetSideCotnroller(component, parameter1);

3
  • Where can we Study this one.. will you give me a tutorial link for that so that i can deeply understand and study how to use helper . Thank you I really appreciate your will to help. – Danryl Tigol Carpio Aug 14 '15 at 7:24
  • You can use Trail head which will give you knowledge very quickly. and if you want go through deep into lightning. this link is useful resources.docs.salesforce.com/sfdc/pdf/lightning.pdf – Ankuli Aug 14 '15 at 7:41
  • Will you give me an example of code that will use a helper, JS( client side controller),apex(server side controller) , and aura componet. Please .. – Danryl Tigol Carpio Aug 14 '15 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.