How can i check the following in aura

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

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

2 Answers 2


try with greaterthan function


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


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

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

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

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

You must log in to answer this question.

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