How can transitionToRoute be called cleanly from within an Ember component?
It works with injecting a controller into the component and calling the cont
Use
router: service()
instead of
router: service('-routing')
import Component from '@ember/component';
import {inject as service} from '@ember/service';
export default Component.extend({
router: service(),
actions: {
onClick(params) {
let route = this.getMyRoute(params);
this.get('router').transitionTo(route);
}
}
});