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

2 Answers 2

11

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>
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
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>

You must log in to answer this question.

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