I have been trying to to simplify a nested <aura:if isTrue> into a single line. I thought I could wrap this with an or(statement1,statement2) but I think I'm missing something. The expected functionality works with the nested statement, the functionality is to only show option 'y' when 'x' is selected beforehand.
<aura:if isTrue="{!or(and(v.object.field__c == 'x' , item.label == 'y'), item.label != 'y')}">
<aura:if isTrue="{!or(and(v.object.field== 'x' , item.label == 'z'), item.label != 'z')}">
<option selected = "{!item.selected}" value="{!item.value}">{!item.label}</option>
</aura:if>
</aura:if>
My attempt
<aura:if isTrue="{or(!or(and(v.object.field__c == 'x' , item.label == 'y'), item.label != 'y'),!or(and(v.object.field== 'x' , item.label == 'z'), item.label != 'z'))}">
<option selected = "{!item.selected}" value="{!item.value}">{!item.label}</option>
</aura:if>
Attempt with And
and((!or(and(v.object.field__c == 'x',item.label == 'y'), item.label != 'y')),(!or(and(v.object.field__c == 'x',item.label == 'z'), item.label != 'z')))
Any help would be greatly appreciated.
if (a) { if (b) { x } }
is equivalent toif (a AND b) { x }
.and
andor
parameters.