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
SCOTT purcellSCOTT purcell 

Help with - Defining Component attributes

I cannot seem to pass this challenge and I have tried so many different ways.
Here is my  code for .cmp and .app
<aura:component>
    <aura:attribute name="Street" type="String" />
    <aura:attribute name="City" type="String" />
    <aura:attribute name="State" type="String" />
    <aura:attribute name="PostalCode" type="String" />
    
    <div class="addressDetails">
        <div class="street">Street: {!v.Street}</div>
        <div class="state">State: {!v.State}</div>
        <div class="city">City: {!v.City}</div>
        <div class="postalCode">ZipCode: {!v.PostalCode}</div>
    </div>
    
</aura:component>
and my .app
<aura:application >
    
    <h1>Starting the DisplayAddress component</h1>
    <c:DisplayAddress Street="22 north" City="Provo" State="ut" PostalCode="99900"/>
   
</aura:application>

If anyone could help that we be awesome,
TIA
Scott
 
Best Answer chosen by SCOTT purcell
VinojVinoj
Hey Scott,

What error did you get when you tried to submit this? I don't see any issues with the component.  I don't believe you need an application.  The component alone should be fine.  Here's what I used:
 
<aura:component implements="force:appHostable">
    <aura:attribute name="Street" type="String" default="123 Bay Street"/>
    <aura:attribute name="City" type="String" default="San Francisco" />
    <aura:attribute name="State" type="String" default="California" />
    <aura:attribute name="PostalCode" type="String" default="94105"/>
    {!v.Street}<br />
    {!v.City}, {!v.State}<br />
    {!v.PostalCode}
</aura:component>

 

All Answers

VinojVinoj
Hey Scott,

What error did you get when you tried to submit this? I don't see any issues with the component.  I don't believe you need an application.  The component alone should be fine.  Here's what I used:
 
<aura:component implements="force:appHostable">
    <aura:attribute name="Street" type="String" default="123 Bay Street"/>
    <aura:attribute name="City" type="String" default="San Francisco" />
    <aura:attribute name="State" type="String" default="California" />
    <aura:attribute name="PostalCode" type="String" default="94105"/>
    {!v.Street}<br />
    {!v.City}, {!v.State}<br />
    {!v.PostalCode}
</aura:component>

 
This was selected as the best answer
SCOTT purcellSCOTT purcell
SO I even tried your code and i keep getting:
Challenge not yet complete... here's what's wrong: 
The component is not using any attributes

I dont know what i am doing wrong...
SCOTT purcellSCOTT purcell
I went in and deleted my component and the app and made a new component.  The code works fine now.  Thank you for the answer it helped me troubleshoot.
mario gomesmario gomes
qqqqqqqqqqqq
Ghanshyam Yadav01Ghanshyam Yadav01
Hi SCOTT, i am also facing same issue(The component is not using any attributes), can u tell me how to delete both Component and application from developer consolve.

Regards,
Ghanshyam 
ArenoAreno
Hi Everyone,

The code works perfectly fine with me. Just create a Lightining Component and save it.

<aura:component implements="force:appHostable">
    <aura:attribute name="Street" type="String" default="123 Street"/>
    <aura:attribute name="City" type="String" default="Teaneck" />
    <aura:attribute name="State" type="String" default="New Jersey" />
    <aura:attribute name="PostalCode" type="String" default="07666"/>
    {!v.Street}<br />
    {!v.City}, {!v.State}<br />
    {!v.PostalCode}
</aura:component>