This should not be used, we now have Named Blocks https://guides.emberjs.com/release/components/block-content/#toc_named-blocks
A stop-gap for the named yields RFC and based off the experimentation here.
ember install ember-named-yields
Setup the named yields in your component template:
The {{yield}}
is the body yield in this example.
Now to use this component:
This named yield implementation adds extraneous DOM elements to make this work, so keep that in mind when using this addon.
Topics beyond the basic usage.
Both named-yield
and block-for
components take a second positional param which is "optional" since we fallback
to a private API, i.e. parentView
. If you don't want to use the private API, set the context manually.
To allow more control to the end user, e.g. dynamically set the block to yield to.
And can be used like so:
Which allows using concat
or other helpers to dynamically set the name.
By default if you call a block-for
multiple times, it overwrites the previous content. Sometimes
you might want to append to the previous content.
Now the header will have 'AB' as it's contents.
See the CONTRIBUTING.md.