ember.js - Transition to current route with different upstream/parent dynamic segment in ember? -


i have peculiar case.

say on root.com/product/1/detail

i want able change product dynamic segment, still in detail sub route. example `root.com/product/2/detail

and if in root.com/product/1 want same transition code go `root.com/product/2

normally, you'd put transitiontoroute('product', this.get('id')), takes me product route. need flexibility of preserving sub routes visitor may in.

perhaps there sort of "currentroute" property can hook transitiontoroute('controller.currentroute', this.get('id')) while passing in new ids or objects dynamic segments?

you can set current route using:

currentroute = app.__container__.lookup('controller:application').get('currentpath') 

then should able along lines of mentioned:

transitiontoroute('currentroute', this.get('id')) 

Popular posts from this blog