I’m trying to understand how to use nested routes.
My code:
App.Router.map(function() {
this.route("site", { path: "/" });
this.route("about", { path: "/about" });
this.resource("team", {path:'/team'}, function(){
this.resource('bob',{path:'/bob'});
});
});
And I’m trying to get to the Bob page with:
{{#linkTo 'bob'}}bob{{/linkTo}}
What am I missing?
Thanks.
try instead
Between you can simplify your router map this way – you only need to specify the path if it’s different from the route name.
UPDATE
See a working example here
In summary, You need to provide an implementation of the renderTemplate function of TeamBobRoute where you explicitly specify where you want to render your template
bob. Using the render optionintoyou can override the default behaviour, rendering to the parent outlet, and pick which parent template to render toFYI the render method supports the following options:
into, outlet and controlleras described below.If you had a named template inside your application template then you would target it this way