The aura:method command is a very useful utility that allows for defining methods in the child component API, so that a parent component can call the method directly, without having to create event files.
Let's look at the following sample code to understand the syntax.
Let's create a child component with the aura method, as follows, and name the component childMethodCmp:
<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>/* auraMethodController.js */({ doAction : function(cmp, event) { var params = event.getParam('arguments'); ...