我想在使用查询字符串成功登录后将用户重定向到另一个页面。如果我复制并粘贴到浏览器的地址栏 http://example.com/#/login?ref=/path/to/redirect
它工作正常。但如果我使用
$location.path("/login?ref=/path/to/redirect");
网址看起来像
http://example.com/#/login%3Fref=/path/to/redirect
如何将 %3F 解码为“?” ? 谢谢
最佳答案
应该是
$location.path('/login').search('ref', '/path/to/redirect')
关于javascript - 如何在 AngularJS 中将查询字符串与 $location.path() 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24188562/