{{outlet}} in component


#1

In a transition to Ember 2.0 I have written {{#blog-posts posts=model page=page perPage=perPage query=query createAction="createPost"}}{{outlet}}{{/blog-posts}} and it works. I am not sure this the proper way to use {{outlet}} in a component?. Can I pass it in a non block form as a parameter?

Source: https://github.com/broerse/ember-cli-blog


#2

The proper way won’t be available until routeable components arrive. And it’s my understand that will happen now shortly after 2.0 lands.


#3

So is my hack the best way to do it for now?


#4

I don’t believe this is a hack. If you look at how {{outlet}} is implemented, it is just another view similar to how {{view}} works except it communicates with the router on route changes.


#5

It feels like a hack because to me it seems more logical to pass the outlet in a non block form as a parameter.


#6

An outlet parameter would also not allow errors like this {{#blog-posts posts=model page=page perPage=perPage query=query createAction="createPost"}} {{outlet}} {{/blog-posts}}