3

Long-time reader, first time poster.

I'm completing the lightning components trailhead modules, and am a little confused about the difference between facets nested components.

From the demos, it feels like both are the practically the same thing. You can put a component inside a component, and you can put a component with a facet inside a component. Both let you set attributes in the child from the parent, and I can't really tell the difference in behaviour, and when we shoudl use which.

2

Composition ("putting a component inside a component") is really just shorthand for:

<aura:set attribute="body">
Some body content here
</aura:set>

its just syntactic sugar for the most common use of facets. Under the covers they are just facets.

  • Never got around to approving this. The more I've played with lightning, the more I've realised they are the same thing :) – smatharu Dec 2 '15 at 13:33

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.