Activity Forums Salesforce® Discussions How to create reusable methods in Lightning JS client side controller for reuse within the client side controller itself?

  • Himanshu

    July 28, 2016 at 10:27 am

    Hi Tanu,

    All the reusable code in the helper section in lightning -  "helper.functionname(component,event)". In case, if the helper method themselves need to call other methods, then you can call the same by using the "this" keyword.

  • Ajay Prakash

    February 28, 2018 at 5:03 am

    I agree with Himanshu. If you write the code in the helper.js then this code will be accessible from the controller.js, renderer.js and helper.js itself. It will improve your code reusability.



Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos