@alidcastano wrote:
Inside a component,
this.transitionTo
orthis.TransitionToRoute
do not work.My current work around is to inject the router service, for example:
export default Ember.Component.extend({ router: Ember.inject.service('-routing'), actions: { submit: function() { this.get('router').transitionTo('home'); } } });
Is this bad practice? Is there a better way to handle routing from components (that does not include controllers)?
Posts: 5
Participants: 2