0
<aura:iteration items="{!v.contacts}" var="item" indexVar="idx">
  <aura:if isTrue="{!lessthan(idx,5)}"> 
        <ui:outputText value="{!ind}" />
  </aura:if>
</aura:iteration>

Although, "contacts" list got more than 7 elements ... it never enters the Aura: If condition?

thanks If i remove " aura:if " condition 7 rows get populated.

1
  • could you please add your code - without code, we will not be able to assist. Commented Jan 24, 2018 at 10:11

1 Answer 1

1

The bugs in your code is using <aura:if isTrue="{!lessthan(idx,5)}"> for lessthan use &lt; i.e):<aura:if isTrue="{!idx &lt; 2}">

Example Code:

<aura:application extends="force:slds">
<aura:iteration items="[1,2,3,4,5]" var="item" indexVar="idx">
  <aura:if isTrue="{!idx &lt; 2}"> 
        <ui:outputText value="{!item}" />
  </aura:if>
</aura:iteration></aura:application>
2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .