12

As I was playing around with the Lightning Component's documentation I saw that in order to display an example, I need to provide a reference to an actual example, but I haven't figured any possible way to provide that example without creating another component for it.

On the other hand, if I create an example component, the Component Library will list it as an available component, which I don't want it to.

Have you guys come across this and tried to fix it?

This is how the .auradoc looks as of now:

<aura:documentation>
    <aura:description>
        <p>
            An <code>c:ReminderOpportunitiesTable</code> component displays a paginated and sortable table
            with all the opportunities which don't have automatic reminders.
        </p>

        <p>
            This example illustrates how to use the component.
        </p>

        <pre>
&lt;aura:application description="RemindersDashboard" extends="force:slds"&gt;
      &lt;c:ReminderOpportunitiesTable /&gt;
&lt;/aura:application&gt;
        </pre>
    </aura:description>

    <aura:example name="ReminderOpportunitiesTable" ref="c:RemindersOpportunitiesTableExample" label="Using the c:ReminderOpportunitiesTable Component">
        <p>This example shows how to setup <code>ReminderOpportunitiesTable</code>.</p>
    </aura:example>
</aura:documentation>

While my example component is as trivial as:

<aura:component description="RemindersOpportunitiesTableExample">
    <!-- Take into account that this component doesn't have parameters. It's just an embeddable table -->
    <c:ReminderOpportunitiesTable />
</aura:component>
3
  • Do you have a namespace defined in the org you are working on? if so, do ref = "namespace:RemindersOpportunitiesTableExample"
    – Ranga
    Aug 20, 2018 at 8:25
  • @Ranga I don't have any namespace, no. Aug 20, 2018 at 8:34
  • 1
    sorry I think I miss understood what you wanted. I dont think we can hide example component from the library. It would be really nice if Salesforce allow it though. I'll upvote :)
    – Ranga
    Aug 20, 2018 at 8:38

0

You must log in to answer this question.

Browse other questions tagged .