使用 emberJS 从子重定向后触发父重定向

Trigger parent redirection after redirecting from child with emberJS

假设我有一条路线包含另一条路线:

this.route('fields', function () {
  this.route('details', { path: '/:field_name' });
});

父路由:

redirect(model, transition) {
  alert(transition.to.name);
},

子路由:

redirect(model, transition) {
  if (something) this.transitionTo('fields');
},

当我到达子路由时它应该提醒两次(因为有一个到父路由的重定向)。它只提醒一次(在重定向之前)。

如何重新触发父重定向操作?

使用原生 class 语法:

redirect() {
  if (something) super(...arguments);
}

使用 Ember classic class 语法:

redirect() {
  if (something) this._super(...arguments);
}