4

How can i check the following in aura

<aura:if istrue="{!v.flag<2}">
</aura:if>

I want to check whether the value of flag is less than 2 but i am getting error.

Failed to save undefined: markup://c:SFDC_Ltng_Stakeholder:230,49: ParseError at [row,col]:[231,49] Message: The value of attribute "istrue" associated with an element type "aura:if" must not contain the '<' character.: Source
10

try with greaterthan function

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

<aura:if istrue="{!greaterthan(v.flag,2)}">
</aura:if>
| improve this answer | |
  • I think it should be less than according to my requirement. – Deepak Agarwal Apr 24 '17 at 7:07
  • @DeepakAgarwal ok you can use lessthan function. – Ratan Paul Apr 24 '17 at 7:10
0
<aura:if isTrue="{!v.flag < 2}">

</aura:if>

For True condition, set attribute value as below in application,

<aura:application >
    <c:ConditionalComponent edit="true"/>
</aura:application>

For False condition, set attribute value as below in your application,

<aura:application >
    <c:ConditionalComponent edit="false"/>
</aura:application>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.