According to the API docs, this.render()
's option into
can be used to specify where you want to render into, and it said:
Defaults to the parent template
Now I want to change it to a sibling template, I have router like this:
Router.map(function() {
this.route('orders', function() {
this.route('new')
})
})
and orders/index
had already implemented with a {{outlet}}
in its template.
then, to render orders/new
into orders/index
’s {{outlet}}
, I try this in OrdersNewRoute
:
Ember.Route.extend({
renderTemplate() {
this.render('orders/new', {
into: 'orders/index'
}
}
I thought this should works, but when I enter /orders/new
url, Ember throws an error to me:
Uncaught Error: Assertion Failed: You attempted to render into ‘orders.index’ but it was not found
I’m confused because API doc doesn’t implies that you can’t render into another sibling template, my guess is: since sibling route will not be activated, so Ember just don’t know if its template is available to render into.
Am I right? or are there some further informations that doc didn’t mention?