Reputation: 4095
Router
this.route('administration', function() {
this.route('users', { path: '/' });
this.route('users');
});
routes/administration.js
actions: {
didTransition() {
console.log('administration didTransition');
}
}
routes/users.js
actions: {
didTransition() {
console.log('users didTransition');
}
}
When go to url: localhost:3000/administration/users
users
's didTransition
got called, but administration
's didTransition
wont get called, can anyone help me on debugging it or the relationship between parent/ children routes?
I'd like to know which lines of code caused such? Thanks.
Upvotes: 1
Views: 415
Reputation: 4095
It turned out
Ember routes is NOT hitting fromparent -> child
, instead, it uses bubbling up. So by adding return true;
in the child's didTransition
function. Child's didTransition
will bubble up.
Ember will hit child -> parent
.
routes/users.js
actions: {
didTransition() {
console.log('users didTransition');
return true;
}
}
Thanks @dwickern and @mithrilhall
Upvotes: 2