我有一个 ember 应用程序,我在其中进行一些条件重定向,但希望能够在用户跳过一些障碍后将请求传递到它的原始位置。
我有这样的东西(咖啡脚本)
Ember.Route.reopen: ->
redirect: ->
if @controllerFor('specialOffers').get('should_offer')
#This next line is what I need help with
@controllerFor('specialOffers').set('pass_through', HOW_DO_I_GET_STRING_NAME_OF_CURRENT_ROUTE)
# After this property is set and the user interacts
# with the special offers, they will be redirected back
# to wherever they intended to go
@transitionTo('specialOffers')