Multiple conditions

Use multiple conditions in aura:if on lightning component

Lightning Component

Sharing is caring!

Prerequisites : basic understanding of Lightning Components.

aura:if evaluates the isTrue expression on the server and instantiates components in either it’s body or else attribute. Only one branch is created and rendered. Switching condition unrenders and destroys the current branch and generates the other

In aura:if tag we can not use [&& ,AND ,||, OR] operator for use multiple conditions  in isTrue attribute, but….
we can use logical Functions in aura:if tag like  or(), and() . in this sample code we can see how to use multiple Boolean conditions in aura:if tag.

 Use Multiple conditions sample code :

component [sample.cmp]

TestApp.app

Output-:

use Multiple conditions in aura:if image
output

Bravo!! Like our facebook page for new post updates.

Sharing is caring!

(Visited 17,652 times, 17 visits today)

Leave a Reply