The <aura:method> tag has these system attributes.
An <aura:method> can optionally include parameters. Use an <aura:attribute> tag within an <aura:method> to declare a parameter for the method. For example:
<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>
You don’t need an access system attribute in the <aura:attribute> tag for a parameter.
This handler action shows how to access the arguments passed to the method.
({ doAction : function(cmp, event) { var params = event.getParam('arguments'); if (params) { var param1 = params.param1; // add your code here } } })
Retrieve the arguments using event.getParam('arguments'). It returns an object if there are arguments or an empty array if there are no arguments.
aura:method executes synchronously.