Skip to main content
Hello guys,

I wanted to test components but has faced that documentation for component can't be added.

For test i used component created during passing trailhead "Quick Start: Lightning Components (https://developer.salesforce.com/trailhead/project/quickstart-lightning-components)" for documentation was took fragment from "Lightning Components Developer’s Guide" (https://resources.docs.salesforce.com/sfdc/pdf/lightning.pdf) p.61

Here is code examples and screenshots:

Component:

<aura:component controller="MyContactListController">

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

<aura:attribute name="contacts" type="Contact[]" />

<ul>

<aura:iteration items="{!v.contacts}" var="contact">

<li class="minli"> <h3>{!contact.Name}</h3> </li>

</aura:iteration>

</ul>

</aura:component>

JS controller:

({

myAction : function(component, event, helper) {

var action = component.get("c.getContacts");

action.setCallback(this, function(data) {

component.set("v.contacts", data.getReturnValue());

});

$A.enqueueAction(action);

}

})

Documentation:

<aura:documentation>

<aura:description>

<p>An <code>np:MyContactList</code> component represents an element that executes an action defined by a controller.</p>

<!--More markup here, such as <pre> for code samples-->

</aura:description>

<aura:example name="myComponentExample" ref="np:myComponentExample" label="Using the np:MyContactList Component">

<p>This example shows a simple setup of <code>MyContactList</code>.</p>

</aura:example>

<aura:example name="mySecondExample" ref="np:mySecondExample" label="Customizing the np:MyContactList Component">

<p>This example shows how you can customize <code>MyContactList</code>.</p>

</aura:example>

</aura:documentation>

And here are screenshots:

How to add documentation to lightning component?User-added imageUser-added image

What am i doing wrong?
5 answers
  1. Oct 2, 2015, 12:17 PM
    Unfortunately, removing  <aura:example>  doesn't help.

    Additionaly, documentation section in reference.app is empty for all custom components, even for installed from AppExchange.
0/9000