Using Block Params
Using Block Params
Components can have properties passed in (Passing Properties to a Component), but they can also return output to be used in a block expression.
Return values from a component with yield
app/templates/index.hbs
{{blog-post post=model}}
app/templates/components/blog-post.hbs
{{yield post.title post.body post.author}}
Here an entire blog post model is being passed to the component as a single component property. In turn the component is returning values using yield
. In this case the yielded values are pulled from the post being passed in but a