You can just yield a hash of components. Every time the component is null, it's not rendered: hbs
<header>{{yield (hash header=(component 'some-header-container'))}}</header>
<div class="body">{{yield (hash body=(component 'some-body-container')}}</div>
<footer>{{yield (hash footer=(component 'some-footer-container')}}</footer>
{{#my-comp as |section|}}
{{#section.header}}
My header
{{/section.header}}
{{#section.body}}
My body
{{/section.body}}
{{#section.footer}}
My footer
{{/section.footer}}
{{/my-comp}}
If a bit longer, it's much cleaner.
Achievements
1
Karma
34,270
Total ProTip Views
24PullRequests Participant
Sent at least one pull request during the first 24 days of December 2014
You can just yield a hash of components. Every time the component is null, it's not rendered:
hbs <header>{{yield (hash header=(component 'some-header-container'))}}</header> <div class="body">{{yield (hash body=(component 'some-body-container')}}</div> <footer>{{yield (hash footer=(component 'some-footer-container')}}</footer>
If a bit longer, it's much cleaner.