I was looking for the answer to this question, in the end I got a solution.
My scenario was that I wanted to transfer a component to another component and display it inside that component, which is similar to what this question was aiming for.
For those who donβt know how the {{component}} helper works:
Use it to display another component.
{{component "component-name" param1="value" param2="value"}}
This will work just like:
{{component-name param1="value" param2="value"}}
In my script, I did this:
In the template calling the first component:
{{my-comp-1 comp=(component "my-comp-2" param1="value" param2="value") other-param="value"}}
In the my-comp-1 template, use the attribute used for the component:
{{component comp}}
That was all I needed to do.
This works great with Ember 2.7.0.
Jayant bhawal
source share