• <legend id='wGWKA'><style id='wGWKA'><dir id='wGWKA'><q id='wGWKA'></q></dir></style></legend>
  • <tfoot id='wGWKA'></tfoot>

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

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

        Angular ui-router 中 $state.transitionTo() 和 $state.go() 之间的区

        时间:2023-09-30

        1. <tfoot id='yKPeE'></tfoot>
            <bdo id='yKPeE'></bdo><ul id='yKPeE'></ul>
            • <small id='yKPeE'></small><noframes id='yKPeE'>

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

              <legend id='yKPeE'><style id='yKPeE'><dir id='yKPeE'><q id='yKPeE'></q></dir></style></legend>

                    <tbody id='yKPeE'></tbody>

                1. 本文介绍了Angular ui-router 中 $state.transitionTo() 和 $state.go() 之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 AngularJS 中,我看到有时我们使用 $state.transitionTo(),有时我们使用 $state.go().谁能告诉我它们有何不同以及何时应该使用一个而不是另一个?

                  In AngularJS, I see sometimes we use $state.transitionTo() and sometimes we use $state.go(). Can anyone tell me how they differ and when one should be used over the other?

                  推荐答案

                  你指的是AngularUI 路由器?如果是这样,wiki 指定差异:

                  Are you referring to the AngularUI Router? If so, the wiki specifies the differences:

                  $state.go(to [, toParams] [, options])

                  返回一个表示转换状态的 Promise.

                  Returns a Promise representing the state of the transition.

                  转换到新状态的便捷方法.$state.go 在内部调用 $state.transitionTo 但自动将选项设置为 { location: true, inherit: true, relative: $state.$current, notify:真}.这使您可以轻松地使用绝对路径或相对路径,并仅指定您想要更新的参数(同时让未指定的参数从当前状态继承).

                  Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the current state).

                  $state.transitionTo(to, toParams [, options])

                  返回一个表示转换状态的 Promise.

                  Returns a Promise representing the state of the transition.

                  转换到新状态的低级方法.$state.go() 在内部使用 transitionTo.$state.go() 在大多数情况下推荐使用.

                  Low-level method for transitioning to a new state. $state.go() uses transitionTo internally. $state.go() is recommended in most situations.

                  这篇关于Angular ui-router 中 $state.transitionTo() 和 $state.go() 之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:AngularJS - 启用没有 404 错误的 HTML5 模式页面刷新 下一篇:使用启用 Html5 模式的 Angular Ui 路由器时页面重新加载失败

                  相关文章

                    <tfoot id='JHnl9'></tfoot>

                    • <bdo id='JHnl9'></bdo><ul id='JHnl9'></ul>

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

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