【发布时间】:2013-03-04 09:01:38
【问题描述】:
在 Angularjs 应用程序中,我有一个类似 http://url.com/my_app/#/store/items 的网址。
现在我想附加查询字符串,例如,http://url.com/my_app/#/store/items?page=2。
但在 url 中,javascript 对我不想要的 "?" to "%3F" 进行编码。它应该保留“?”仅在 url 中,因为 angularjs $location.search() 不为“%3F”返回任何内容。
怎么做?
【问题讨论】:
-
URL 模式应该看起来像
http://url.com/my_app/#/store/items/page/2而不是http://url.com/my_app/#/store/items?page=2。因为在#之后使用/模式而不是?模式可能更正确 -
不,我只想在 qurystring 中添加它。它的要求//
-
为什么不使用
$location.search('page',2)来设置查询?还是使用 routeparams? -
谢谢.. 没错!!
标签: javascript angularjs