function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Flint LockwoodFlint Lockwood 

aura:renderIf AND Operator Syntax

What is the correct syntax for the AND operator using the <aura:renderIf> tag? I tried <aura:renderIf isTrue="{!AND(condition1, condition2)}", but got a compile error. I also tried "AND(condition1, condition2)". No compile error, but it didn't function correctly. 
Best Answer chosen by Flint Lockwood
Rajiv Penagonda 12Rajiv Penagonda 12
and Option 1 is the correct choice:
 
<aura:component>
    <aura:if isTrue="{!AND(v.attribute1, v.attribute2)}">
    True
    <aura:set attribute="else">
      False
    </aura:set>
  </aura:if> 
</aura:component>

 

All Answers

Rajiv Penagonda 12Rajiv Penagonda 12
Hi, aura:renderIf is deprecated (see details here (https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_aura_renderIf.htm)). You need to use aura:if.
 
<aura:component>
    <aura:if isTrue="{!v.truthy}">
    True
    <aura:set attribute="else">
      False
    </aura:set>
  </aura:if> 
</aura:component>

 
Rajiv Penagonda 12Rajiv Penagonda 12
and Option 1 is the correct choice:
 
<aura:component>
    <aura:if isTrue="{!AND(v.attribute1, v.attribute2)}">
    True
    <aura:set attribute="else">
      False
    </aura:set>
  </aura:if> 
</aura:component>

 
This was selected as the best answer
sfdcMonkey.comsfdcMonkey.com
hi Flint Lockwood
go to below linke for it solution
https://teachforce.wordpress.com/2016/12/03/use-multiple-conditions-in-in-lightning-component/
i hope it helps you
let me inform if it helps you and mark it best answer if it helps you so it meke proper solution for other
thanks
Flint LockwoodFlint Lockwood
Thanks. The "and" has to be lowercased.