function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kruthika saikruthika sai 

Lightning COmponent - Using Expressions challenge is failing.

I am facing an error - The component is not evaluating the value of the 'DayOfTheWeek' attribute to determine what to display
Please help me find out what is wrong.

<aura:component >
     <aura:attribute name="DayOfTheWeek" type="String" />
    <aura:if isTrue="{!v.DayOfTheWeek}">
            Today is {!v.DayOfTheWeek}
            <aura:set attribute="else">
                Error,,.
            </aura:set>
        </aura:if>
</aura:component>
Rita LeverettRita Leverett
I had the same problem. The aura:if example in the course only works with "Boolean" not "String". You need to set up a default value and a 2-sided aura:if expression. Try the below.

<aura:component >
     <aura:attribute name="DayOfTheWeek" type="String" default="Monday" />
    <aura:if isTrue="{!v.DayOfTheWeek == 'Monday'}">
            Today is {!v.DayOfTheWeek}
            <aura:set attribute="else">
                Today is not {!v.DayOfTheWeek}
            </aura:set>
        </aura:if>
</aura:component>

If this doesn't work, try refreshing your screen, then check challenge again.