QuestionQ86

VerifiedBasic Lightning Web Component Development

Which template correctly shows the details message only when areDetailsVisible changes to true, given the following Lightning Web Component code?

Question Image

Explanation

The if:true={areDetailsVisible} directive binds the template’s rendering to the Boolean areDetailsVisible property, so its nested content is rendered only when the property is truthy. Salesforce now recommends lwc:if={areDetailsVisible} for new code, but if:true={expression} is the valid legacy directive represented by the available choices.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!