Monday, February 6, 2017

How to use conditional statements IF, Else in lightning components?.

How to use conditional statements IF, Else in lightning components?.


In the below example components I am using IF and Else conditions in components.

IFComp:



In the above screen shot I am using aura:attribute  to define variable with name as “change”, data type as boolean for this I assigned a default value as TRUE.
In line number seven I am starting IF condition with <aura:if> tag. If you want to define conditional expression in lightning components we have to use <aura:if>  . if the change variable value is TRUE then I am displaying button with test as “I am True”, else I am displaying button with label as “I am false”
In line number ten I am using else block for the above if condition, for this we have to use the tag of <aura:set attribute=”else”/>


<ui:button> is used to create buttons in lightning components.

Output 1: 

Here I will the button the button label as true, because of I assigned default value for the “Change” variable as true.



Output 2:











12 comments:

Nbits said...

thank you for sharing such a good and useful information, please keep on share like this
salesforce training in hyderabad
salesforce online training

DebbieSmith said...

At times you should go out in the field with reps without warning them before hand. Use a random selection method for this process.

Clinically Oriented Anatomy test bank & solutions manual

JamesLynch said...

Exceptional post but I was wanting to know if you could write a litte more on this subject? I'd be very thankful if you could elaborate a little bit further. Many thanks!
Civilization in the West test bank solutions manual

Unknown said...

Very Impressive Salesforce tutorial. The content seems to be pretty exhaustive and excellent and will definitely help in learning Salesforce course. I'm also a learner taken up Salesforce training and I think your content has cleared some concepts of mine. While browsing for Salesforce tutorials on YouTube i found this fantastic video on Salesforce. Do check it out if you are interested to know more.:-https://www.youtube.com/watch?v=ZV0-1lCcAbU

Bharat said...

Wonderful blog post, thank you so much for the great information which you provided.
Top 5 features of salesforce lightning

Amit Kumar Singh said...


i am a freelancer and work according to contract, for more details contact us with the information provided below.
play game and win snapdeal lucky draw coupon 2019. contact us, play and win snapdeal lucky draw winner prizes.
lucky draw snapdeal contact number 6289379055 call to get more information
Lucky Draw Snapdeal costomer care number
snapdeal lucky draw contact number
snapdeal lucky draw contest 2019
snapdeal lucky draw 2019 list
snapdeal lucky draw contact number
snapdeal lucky draw 2019

Best Regards
snapdeal lucky draw winners 2019

TNK Design Desk said...

Very useful and informative blog. Thank you so much for these kinds of informative blogs.
who provides seo services and e-commerce development services.
best website design services in gurgaon
best web design company in gurgaon
best website design in gurgaon
website design services in gurgaon
website design service in gurgaon
best website designing company in gurgaon
website designing services in gurgaon
web design company in gurgaon
best website designing company in india
top website designing company in india
best web design company in gurgaon
best web designing services in gurgaon
best web design services in gurgaon
website designing in gurgaon
website designing company in gurgaon
website design in gurgaon
graphic designing company in gurgaon
website company in gurgaon
website design company in gurgaon
web design services in gurgaon
best website design company in gurgaon
website company in gurgaon
Website design Company in gurgaon
best website designing services in gurgaon
best web design in gurgaon
website designing company in gurgaon
website development company in gurgaon
web development company in gurgaon
website design company
website designing services

Chandra Sekhar Reddy said...

Nice Information
"Sanjary Academy provides excellent training for Piping design course. Best Piping Design Training Institute in Hyderabad,
Telangana. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller
course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course."
Piping Design Course
Piping Design Course in India­
Piping Design Course in Hyderabad
Welding Inspector Course
Quality Management Course
Quality Management Course in india
Safety officer course

Mohit Bansal said...

Want to bulk clone multiple custom fields and objects in Salesforce in few clicks, Appexchange app named as Bulk Object Field Creator Most recommended and appreciable app by Salesforce MVP

KGRN said...

Thanks for sharing this. Learned some new things about conditional statements.
Audit firms in dubai
Accounting firms in dubai
Economic Substance Regulations UAE

WordPar International said...

Very nice article. Thanks for sharing such helpful blog post.

Voice-Over Services
Voice Over Services India

enstyleplanners said...

Nice Article! Are you looking for the best mobile app development companies in madhapur that will be helpful for your business. We provide efficient methodologies for the successful implementation of app development company in hyderabad | mobile app development hyderabad | mobile application development company hyderabad | mobile application development companies in hyderabad | ecommerce solutions hyderabad | best mobile app development company in hyderabad | mobile application development company in hyderabad | mobile development company hyderabad | mobile app development services in hyderabad | best mobile app developers in hyderabad .
Thank you!

Post a Comment

 
| ,