Skip to main content
1 of 2
itsmebasti
  • 6.6k
  • 3
  • 45
  • 92

It could be very useful sometimes, but you can't call methods like that (you can only invoke them with events) and you can't pass parameters to them. So in your case, I would recommend creating a component that you render in your iteration:

<aura:iteration items="{!v.myObjects}" var="obj">
    <c:yourComponent value="{!obj}" param="{parameter}" />
</aura:iteration>

And your component could look like this:

<aura:component>
    <aura:attribute name="value" type="Object">
    <aura:attribute name="param" type="String">
    <aura:attribute name="isRendered" type="Boolean" access="private">

    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <aura:if isTrue="{!v.isRendered}">
        <!-- ... -->
    </aura:if>
</component>


doInit: function(cmp) {
    var rendered = //doSomethingWithParam
    cmp.set("v.isRendered", rendered);
}
itsmebasti
  • 6.6k
  • 3
  • 45
  • 92