Route renderTemplate with two Outlets

As far as I can determine it is only possible if the route is nested. There is no way to tell a route not to replace the current route – even if you use a named outlet, and don’t have a generic render call in renderTemplate – unless that current route is a parent of the route you are transitioning to.

So, if you have Parent->Account route hierarchy and Parent renders into {{outlet}} and Account renders into {{outlet pane}} it will work. You need a specific renderTemplate: render(outlet: pane).

But if you want Account route to overlay on a sibling route or anything other than an immediate Parent route, you cannot currently do this. Even though you do renderTemplate: render(outlet: pane), the regular {{outlet}} will be cleared.

This issue I am having is actually related: if there was an ability to specify that particular routes should not destroy particular outlets, caching expensive views would be easy. This question I asked about displaying multiple master/detail editors simultaneously is also the same issue at heart. After trying many things, what I ended up doing in the app I am currently developing is to have 1 top level template which renders and/or has named outlets for everything, and under which all routes are nested. Sibling routes won’t destroy each other if they don’t render themselves but are rendered by their parent.

This github issue discussion is also related.

1 Like