Using this.transitionToRoute('path')
throws the following error Cannot read property 'mountPoint' of undefined
export default class TransactionController extends Controller {
@action
redirectToProductsPage() {
this.transitionToRoute('products.sent');
}
}
Using @service router
throws the following error ```
redirectToProductsPage() {
this.router.transitionTo('products.sent');
}
How can I use redirect to a certain route in Ember Octane controllers?
There is something else going on here, because Octane doesn’t affect this behavior at all (we have many of these Controller classes fully Octane-ified on the LinkedIn.com app, for example, without this issue). The service injection message also indicates something else is wrong with the controller in question. For debugging, I would start by removing (stashing or commenting out) everything but the controller class definition, itself (no body, no methods, no injections) and the same for the template, and then slowly add back in pieces till you figure out what’s going wrong.