gpt4 book ai didi

javascript - Angular ui-router 1.0.3 reloadOnSearch 等效项

转载 作者:行者123 更新时间:2023-12-03 04:09:03 24 4
gpt4 key购买 nike

我最近从 v0.3.2 升级到 UI-router v1.0.3。似乎 reloadOnSearch 已从 stateConfig 中删除。

v1.0.3 中 reloadOnSearch 的等效项是什么?我似乎在文档中找不到任何内容。

文档似乎表明它在 v0.2.5 中被删除(但我在 v0.3.2 中使用它)

reloadOnSearch v0.2.5

Boolean (default true). If false will not retrigger the same state just because a search/query parameter has changed. Useful for when you'd like to modify $location.search() without triggering a reload.

最佳答案

您可以使用动态参数。

https://ui-router.github.io/ng1/docs/latest/interfaces/params.paramdeclaration.html

来自文档

When dynamic is true, changes to the parameter value will not cause the state to be entered/exited. The resolves will not be re-fetched, nor will views be reloaded.

Normally, if a parameter value changes, the state which declared that the parameter will be reloaded (entered/exited). When a parameter is dynamic, a transition still occurs, but it does not cause the state to exit/enter.

This can be useful to build UI where the component updates itself when the param values change. A common scenario where this is useful is searching/paging/sorting.

关于javascript - Angular ui-router 1.0.3 reloadOnSearch 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44411366/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com