0

I copied this straight from Lightning Components Developer Guide and there is 404 error and I don't know why and how to fix it.

<aura:handler name="init" value="{!this}" action="{!c.init}" />
<div class="content">

    <lightning:icon iconName="action:approval" size="large" alternativeText="Indicates approval"/>

    <h2>Accounts With Contacts</h2>
    <ul class="table">
        <li class="header">
            <p>Account Name</p>
            <p>Billing State</p>
            <p>Phone</p>
            <p>Website</p>
        </li>
        <aura:iteration items="{!v.accounts}" var="account">
            <li class="rows">
                <p>{!account.Name}</p>
                <p>{!account.BillingState}</p>
                <p>{!account.Phone}</p>
                <p>{!account.Website}</p>
            </li>              
        </aura:iteration>                                           
    </ul>
</div>

  • everything need to be under <aura:component> or aura:application I don't see any of them in the code – Avijit Chakraborty Jun 19 '17 at 15:13
  • @AvijitChakraborty here is my full code but the error still occurs: pastebin.com/Shgh0RT6 – Will Jun 19 '17 at 15:23
1

extends="force:slds" need to be included.

<aura:application extends="force:slds">
        <div class="content">

        <lightning:icon iconName="action:approval" size="large" alternativeText="Indicates approval"/>

        <h2>Accounts With Contacts</h2>
        <ul class="table">
            <li class="header">
                <p>Account Name</p>
                <p>Billing State</p>
                <p>Phone</p>
                <p>Website</p>
            </li>
            <aura:iteration items="{!v.accounts}" var="account">
                <li class="rows">
                    <p>{!account.Name}</p>
                    <p>{!account.BillingState}</p>
                    <p>{!account.Phone}</p>
                    <p>{!account.Website}</p>
                </li>              
            </aura:iteration>                                           
        </ul>
    </div>
    </aura:application>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.