Activity Forums Salesforce® Discussions How we can use aura:method to call child JS Controller in Salesforce?

  • How we can use aura:method to call child JS Controller in Salesforce?

    Posted by Deepak on September 17, 2020 at 9:05 am

    How we can use aura:method to call child JS Controller in Salesforce?

    Anuj replied 3 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Anuj

    Member
    September 17, 2020 at 12:44 pm

    <aura:method> enables you to directly call a method in a component’s client-side controller instead of firing and handling a component event. Using <aura:method> simplifies the code needed for a parent component to call a method on a child component that it contains.
    e.g , how to define parameters in aura:method.
    <aura:method name="sampleMethod" action="{!c.doAction}"
    description="Sample method with parameters">
    <aura:attribute name="param1" type="String" default="parameter 1"/>
    <aura:attribute name="param2" type="Object" />
    </aura:method>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos