Conditional Rendering in Lightning Component using aura:if in Salesforce

Lightning Component:

<aura:component>

<aura:attribute name="strTest" type="String"/>

<aura:if isTrue="{!not(empty(v.strTest))}">
True
<aura:set attribute="else">
False
</aura:set>
</aura:if> 

</aura:component>

Check the below link for more methods

https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/expr_functions.htm

Cheers!!!

No comments:

Post a Comment