Reputation: 25
I have a main template say showcountry.hbs
, inside that I am having a component show-state.hbs
. In show-state.js
I have tried putting this.transitionTo('routename')
. I see that it works for routes other than showcountry
. Complicating thing slightly is that in my router.js
the entry looks something like the following this.route('showcountry' , {path : '/app/mod/country' });
I find that in component when I give the URL pattern in this.transitionTo
it throws unrecognized URL error .
Please help.
Upvotes: 0
Views: 1157
Reputation: 12872
transitionTo
method if you are in route.
transitionToRoute
method If you are in controller.
To transition to the same route, you can use refresh method. So to resolve issue, you need to send action from component to route to call refresh method.
Note: if route is already rendered, then you can't transition to the current route, but if you use dynamic segments or queryParams then you can send that argument to transitionTo method which will call all the model hooks and re-render again. Sample twiddle which demonstrate this
Upvotes: 2