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
Greg DiercksGreg Diercks 

Incorrect Code in "Defining Component Attributes" module?

This code will not compile in the Dev. Console:
<!--docsample:nestedComponents-->
<aura:component>
    Observe!  Components within components!

    <docsample:helloHTML/>

    <docsample:helloAttributes whom="component composition"/>
</aura:component>


This code will compile:

<!--docsample:nestedComponents-->
<aura:component>
    Observe!  Components within components!

    <c:helloHTML/>

    <c:helloAttributes whom="component composition"/>
</aura:component>

The name space is wrong for the two nested components.  (Unless I am completely hallucinating!  And I might be - it's Friday!)
SonamSonam (Salesforce Developers) 
It seems to be working for me..

if you see the section Component Composition on the link:https://developer.salesforce.com/trailhead/lightning_components/lightning_components_attributes

It asks to create two local components and these both will have the namespace set in the org. This way, when we need to access them in other components, we need to use the namespace thus we see    <docsample:helloHTML/>
Dave Durant 1Dave Durant 1

Me too, Greg. The article doesn't say anything about setting your org to the docsample namespace..

Chrisdev ToewsChrisdev Toews
I'm trying to work through this.
on page 50 of this doc: https://resources.docs.salesforce.com/sfdc/pdf/lightning.pdf
I found where you can set your namespace. but you once you set it, it never changes. I'm disinclined to set my namespace to "docsample".
I'm going with Greg on this one.
Thanks Greg,

I also found that I can't preview the helloHTML.cmp component. I had to make an application helloHTMLapp.app with the following code:
<aura:application >
    <c:helloHTML/>
</aura:application>
If there is some other way to preview the helloHTML component in that module, I'd like to know. I've liked all the other Trailhead modules, but this one seems off.

Chris Toews
Ryan LambertRyan Lambert
So glad I'm not the only one who found this module a little "incomplete" in terms of the steps to implement.

@Chrisdev Toews, one other way to "preview" is to add the implements="force:appHostable" to your aura:component tag and then you can create a Lightning Tab for the component and view it in the UI.
Steve J CookSteve J Cook
I'm glad also. This module needs to be reworked a bit. I spent a good amount of time trying to understand what I wasn't "getting" as far as concepts especially with the "Output" for helloHTML.cmp when no app had been created  yet and no way to "preview" it.