When using nested routes, I would like to set params at the top level and be able to access those params or other information in the child routes instead of adding the same params/data in each of the child routes.
@RouteConfig([
{ path: '/users/:id/...', component: Users, as: 'Users' }
])
class App {
}
@RouteConfig([
{ path: '/', component: Profile, as: 'Profile' },
{ path: '/stats', component: Stats, as: 'Stats' }
])
class Users {
constructor(params: RouteParams) {
// need access to Users ID route param
this.id = params.parent.get('id');
}
}
Plunk displays how its handled today.
http://plnkr.co/edit/v1Np3niVn3WNTZBvHQLf?p=preview