<tfoot id='ZhfFg'></tfoot>
      <i id='ZhfFg'><tr id='ZhfFg'><dt id='ZhfFg'><q id='ZhfFg'><span id='ZhfFg'><b id='ZhfFg'><form id='ZhfFg'><ins id='ZhfFg'></ins><ul id='ZhfFg'></ul><sub id='ZhfFg'></sub></form><legend id='ZhfFg'></legend><bdo id='ZhfFg'><pre id='ZhfFg'><center id='ZhfFg'></center></pre></bdo></b><th id='ZhfFg'></th></span></q></dt></tr></i><div id='ZhfFg'><tfoot id='ZhfFg'></tfoot><dl id='ZhfFg'><fieldset id='ZhfFg'></fieldset></dl></div>
      <legend id='ZhfFg'><style id='ZhfFg'><dir id='ZhfFg'><q id='ZhfFg'></q></dir></style></legend>

      <small id='ZhfFg'></small><noframes id='ZhfFg'>

        • <bdo id='ZhfFg'></bdo><ul id='ZhfFg'></ul>
      1. Ember.js RC1 获取路由名称

        Ember.js RC1 get name of route(Ember.js RC1 获取路由名称)

        1. <small id='WJlzJ'></small><noframes id='WJlzJ'>

              <tbody id='WJlzJ'></tbody>

            <tfoot id='WJlzJ'></tfoot>
            <i id='WJlzJ'><tr id='WJlzJ'><dt id='WJlzJ'><q id='WJlzJ'><span id='WJlzJ'><b id='WJlzJ'><form id='WJlzJ'><ins id='WJlzJ'></ins><ul id='WJlzJ'></ul><sub id='WJlzJ'></sub></form><legend id='WJlzJ'></legend><bdo id='WJlzJ'><pre id='WJlzJ'><center id='WJlzJ'></center></pre></bdo></b><th id='WJlzJ'></th></span></q></dt></tr></i><div id='WJlzJ'><tfoot id='WJlzJ'></tfoot><dl id='WJlzJ'><fieldset id='WJlzJ'></fieldset></dl></div>

              • <bdo id='WJlzJ'></bdo><ul id='WJlzJ'></ul>
                <legend id='WJlzJ'><style id='WJlzJ'><dir id='WJlzJ'><q id='WJlzJ'></q></dir></style></legend>
                • 本文介绍了Ember.js RC1 获取路由名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 ember 应用程序,我在其中执行一些条件重定向,但希望能够在用户跳过一些障碍后将请求传递到它的原始位置.

                  I have an ember application where I do some conditional redirecting, but would like to be able to pass the request on through to it's original location after the user has jumped through some hoops.

                  我有这样的东西(咖啡脚本)

                  I've got something like this (coffeescript)

                  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')
                  

                  推荐答案

                  这似乎可行...但我不知道它是否是获取此值的合法方式.

                  This seems to work... but I don't know if it is a legitimate way to get this value.

                  Ember.Route.reopen({
                    redirect: function() {
                      console.log(this.routeName);
                    }
                  })
                  

                  JSFiddle 示例

                  这篇关于Ember.js RC1 获取路由名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  Rails 3.1 ajax:success handling(Rails 3.1 ajax:成功处理)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)

                • <small id='xbhX9'></small><noframes id='xbhX9'>

                    <tbody id='xbhX9'></tbody>
                  1. <legend id='xbhX9'><style id='xbhX9'><dir id='xbhX9'><q id='xbhX9'></q></dir></style></legend>

                        <bdo id='xbhX9'></bdo><ul id='xbhX9'></ul>

                          <i id='xbhX9'><tr id='xbhX9'><dt id='xbhX9'><q id='xbhX9'><span id='xbhX9'><b id='xbhX9'><form id='xbhX9'><ins id='xbhX9'></ins><ul id='xbhX9'></ul><sub id='xbhX9'></sub></form><legend id='xbhX9'></legend><bdo id='xbhX9'><pre id='xbhX9'><center id='xbhX9'></center></pre></bdo></b><th id='xbhX9'></th></span></q></dt></tr></i><div id='xbhX9'><tfoot id='xbhX9'></tfoot><dl id='xbhX9'><fieldset id='xbhX9'></fieldset></dl></div>
                          • <tfoot id='xbhX9'></tfoot>