You need to sign in to do that
Don't have an account?
Greg 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!)
<!--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!)
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/>
Me too, Greg. The article doesn't say anything about setting your org to the docsample namespace..
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: 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
@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.