Reputation: 2930
Consider routes:
this.resource('things', {path: '/things/:id'}, function () {
this.route('edit');
});
Inside controller of the edit
, how do I access the :id
?
Upvotes: 0
Views: 989
Reputation: 12872
You can use the paramsFor
method in the route to get parent route parameters.
So in your case you can also use the setupController
hook of the edit route,
setupController(controller,model){
this._super(...arguments);
let { id } = this.paramsFor(this.routeName);
controller.set('thingsId',id);
}
Upvotes: 2